From 2bfd42f04b34e331398f19e6d0f2e595a344e8e0 Mon Sep 17 00:00:00 2001 From: Arne Beer Date: Thu, 11 Jan 2024 23:05:06 +0100 Subject: [PATCH] ci: Replace actions-rs actions --- .github/workflows/coverage.yml | 6 ++---- .github/workflows/lint.yml | 18 +++++------------- .github/workflows/package-binary.yml | 13 ++++++------- .github/workflows/test.yml | 23 ++++++++++------------- 4 files changed, 23 insertions(+), 37 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8c0218c..a12b79e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -40,12 +40,10 @@ jobs: uses: actions/checkout@v3 - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true components: llvm-tools-preview - target: ${{ matrix.target }} + targets: ${{ matrix.target }} - uses: actions/cache@v3 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b04b2b1..c59e74f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -56,12 +56,10 @@ jobs: uses: actions/checkout@v3 - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true - components: rustfmt, clippy - target: ${{ matrix.target }} + components: llvm-tools-preview + targets: ${{ matrix.target }} - uses: actions/cache@v3 with: @@ -77,13 +75,7 @@ jobs: ${{ runner.os }}-cargo-${{ matrix.target }}- - name: cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run : cargo fmt --all -- --check - name: cargo clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --tests --workspace -- -D warnings + run: cargo clippy --tests --workspace -- -D warnings diff --git a/.github/workflows/package-binary.yml b/.github/workflows/package-binary.yml index a6e9bae..d0cc504 100644 --- a/.github/workflows/package-binary.yml +++ b/.github/workflows/package-binary.yml @@ -83,18 +83,17 @@ jobs: uses: actions/checkout@v3 - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - target: ${{ matrix.target }} - override: true + components: llvm-tools-preview + targets: ${{ matrix.target }} - name: cargo build - uses: actions-rs/cargo@v1 + uses: houseabsolute/actions-rust-cross@v0 with: command: build - args: --release --locked --target=${{ matrix.target }} - use-cross: ${{ matrix.cross }} + args: --release --locked ${{ matrix.cargo_flags }} + target: ${{ matrix.target }} - name: Compress client uses: svenstaro/upx-action@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 260c6fc..fed98c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,12 +70,10 @@ jobs: uses: actions/checkout@v3 - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true components: llvm-tools-preview - target: ${{ matrix.target }} + targets: ${{ matrix.target }} - name: Install cargo-nextest uses: taiki-e/install-action@v2 @@ -95,21 +93,20 @@ jobs: ${{ runner.os }}-cargo-${{ matrix.target }}- - name: cargo build - uses: actions-rs/cargo@v1 + uses: houseabsolute/actions-rust-cross@v0 with: command: build - args: --target=${{ matrix.target }} - use-cross: ${{ matrix.cross }} + target: ${{ matrix.target }} - name: cargo test - uses: actions-rs/cargo@v1 - if: ${{ !matrix.cross }} - env: - NEXTEST_PROFILE: ci # defined in .config/nextest.toml + uses: houseabsolute/actions-rust-cross@v0 with: command: nextest - args: run --workspace --target=${{ matrix.target }} - use-cross: ${{ matrix.cross }} + args: "run --workspace" + target: ${{ matrix.target }} + env: + NEXTEST_PROFILE: ci # defined in .config/nextest.toml + if: ${{ !matrix.cross }} # The test result artifacts are used by the test-report.yaml workflow. - name: upload test results