From 3c22a6dc00c40bd78bfbcb43f6132945a80cb9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Thu, 4 Apr 2024 17:34:28 +0200 Subject: [PATCH 1/4] ci: replace `actions-rs/toolchain` with `dtolnay/rust-toolchain` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Kröning --- .github/workflows/build.yml | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8dd2d5d4..9390a361 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,11 +27,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.rust }} - override: true - name: Run cargo build for stable uses: actions-rs/cargo@v1 with: @@ -76,12 +74,9 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@nightly with: - profile: minimal - toolchain: nightly - override: true - target: x86_64-unknown-linux-musl + targets: x86_64-unknown-linux-musl - name: "Print Rust Version" run: | @@ -151,13 +146,9 @@ jobs: run: echo "$GITHUB_WORKSPACE/binaries/bin" >> $GITHUB_PATH shell: bash - - name: "Install Rustup Components" - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly - override: true - profile: minimal - components: rust-src, llvm-tools-preview + components: rust-src, llvm-tools - name: "Install cargo-xbuild" run: cargo install cargo-xbuild --debug --root binaries - name: "Install bootimage" @@ -197,11 +188,8 @@ jobs: timeout-minutes: 2 steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly - override: true - profile: minimal components: rustfmt - uses: actions-rs/cargo@v1 with: @@ -214,11 +202,8 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly - override: true - profile: minimal components: clippy - uses: actions-rs/cargo@v1 with: From 89773191a7b3d64bc2e3a3d728ab53b81bc9df2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Thu, 4 Apr 2024 17:40:39 +0200 Subject: [PATCH 2/4] ci: remove step for printing rust version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is already done in the previous step. Signed-off-by: Martin Kröning --- .github/workflows/build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9390a361..303fefc9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,11 +78,6 @@ jobs: with: targets: x86_64-unknown-linux-musl - - name: "Print Rust Version" - run: | - rustc -Vv - cargo -Vv - - name: "Run cargo build" uses: actions-rs/cargo@v1 with: From ab4357ce5c8a3968bfa0c6ebc5b798f9349d9aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Thu, 4 Apr 2024 17:42:46 +0200 Subject: [PATCH 3/4] ci: replace `actions-rs/cargo` with direct calls to cargo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Kröning --- .github/workflows/build.yml | 72 +++++++------------------------------ 1 file changed, 13 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 303fefc9..f74e8792 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,36 +30,12 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} - - name: Run cargo build for stable - uses: actions-rs/cargo@v1 - with: - command: build - args: --no-default-features --features instructions - - name: Run cargo build for stable without instructions - uses: actions-rs/cargo@v1 - with: - command: build - args: --no-default-features - - name: Run cargo doc for stable - uses: actions-rs/cargo@v1 - with: - command: doc - args: --no-default-features --features instructions - - name: Run cargo doc for stable without instructions - uses: actions-rs/cargo@v1 - with: - command: doc - args: --no-default-features - - name: Run cargo test for stable - uses: actions-rs/cargo@v1 - with: - command: test - args: --no-default-features --features instructions - - name: Run cargo test for stable without instructions - uses: actions-rs/cargo@v1 - with: - command: test - args: --no-default-features + - run: cargo build --no-default-features --features instructions + - run: cargo build --no-default-features + - run: cargo doc --no-default-features --features instructions + - run: cargo doc --no-default-features + - run: cargo test --no-default-features --features instructions + - run: cargo test --no-default-features test: name: "Test" @@ -78,33 +54,16 @@ jobs: with: targets: x86_64-unknown-linux-musl - - name: "Run cargo build" - uses: actions-rs/cargo@v1 - with: - command: build + - run: cargo build - - name: "Run cargo doc" - uses: actions-rs/cargo@v1 - with: - command: doc + - run: cargo doc - - name: "Run cargo build on musl" - uses: actions-rs/cargo@v1 - with: - command: build - args: --target x86_64-unknown-linux-musl + - run: cargo build --target x86_64-unknown-linux-musl if: runner.os == 'Linux' - - name: "Run cargo test" - uses: actions-rs/cargo@v1 - with: - command: test + - run: cargo test - - name: "Run cargo test on musl" - uses: actions-rs/cargo@v1 - with: - command: test - args: --target x86_64-unknown-linux-musl + - run: cargo test --target x86_64-unknown-linux-musl if: runner.os == 'Linux' - name: "Install Rustup Targets" @@ -186,10 +145,7 @@ jobs: - uses: dtolnay/rust-toolchain@nightly with: components: rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - run: cargo fmt --all -- --check clippy: name: "Clippy" @@ -200,9 +156,7 @@ jobs: - uses: dtolnay/rust-toolchain@nightly with: components: clippy - - uses: actions-rs/cargo@v1 - with: - command: clippy + - run: cargo clippy semver-checks: name: Semver Checks From ed41a384cacb9dafeb4847bb3ceed6b48f4fa788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Thu, 4 Apr 2024 17:43:32 +0200 Subject: [PATCH 4/4] ci: install rustup targets with toolchain action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Kröning --- .github/workflows/build.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f74e8792..113eef39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,7 +52,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@nightly with: - targets: x86_64-unknown-linux-musl + targets: x86_64-unknown-linux-musl, i686-unknown-linux-gnu, thumbv7em-none-eabihf - run: cargo build @@ -66,10 +66,6 @@ jobs: - run: cargo test --target x86_64-unknown-linux-musl if: runner.os == 'Linux' - - name: "Install Rustup Targets" - run: | - rustup target add i686-unknown-linux-gnu - rustup target add thumbv7em-none-eabihf - name: "Build on non x86_64 platforms" run: | cargo build --target i686-unknown-linux-gnu --no-default-features --features nightly