From 41c133b0ea5e7228896eece24703e9ac84322f6a Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Thu, 23 May 2024 23:14:17 +0200 Subject: [PATCH] CI: WIP --- .github/workflows/CI.yaml | 89 ++++++++++++--------------------------- 1 file changed, 26 insertions(+), 63 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 7444a3d..5358126 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -12,13 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v3 - - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + uses: actions/checkout@v4 - name: Install rustfmt run: rustup component add rustfmt - name: Perform format check @@ -35,21 +29,21 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v3 - - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - components: clippy - override: true + uses: actions/checkout@v4 + # - name: Setup Rust toolchain + # uses: actions-rs/toolchain@v1 + # with: + # toolchain: stable + # components: clippy + # override: true - name: Cache cargo tools id: cargo-tools-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: cargo-tools key: lint-tools-${{ env.CARGO_OUTDATED }}-${{ env.CARGO_AUDIT }} - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/.crates.toml @@ -93,15 +87,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v3 - - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/.crates.toml @@ -116,7 +104,7 @@ jobs: - name: Test run: cargo test --locked -- --nocapture - name: Upload linux binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cargo-fixture path: target/debug/cargo-fixture @@ -128,15 +116,9 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@v3 - - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/.crates.toml @@ -152,7 +134,7 @@ jobs: # tests must be run in one thread otherwise they attempt to overwrite each other's exe while building run: cargo test --locked -- --nocapture --test-threads=1 - name: Upload linux binary - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cargo-fixture-exe path: target/debug/cargo-fixture.exe @@ -164,18 +146,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Extract MSRV id: get-msrv run: echo msrv=$(yq .package.rust-version Cargo.toml -oy) | tee -a "$GITHUB_OUTPUT" - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ steps.get-msrv.outputs.msrv }} - override: true + run: rustup toolchain add --profile=minimal ${{ steps.get-msrv.outputs.msrv }} - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/.crates.toml @@ -186,10 +164,7 @@ jobs: target key: msrv-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} - name: Perform MSRV check - uses: actions-rs/cargo@v1 - with: - command: check - args: --locked + run: cargo +${{ steps.get-msrv.outputs.msrv }} check --workspace --tests --locked examples-linux: name: Run examples on Linux @@ -197,15 +172,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v3 - - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/.crates.toml @@ -217,7 +186,7 @@ jobs: examples/http/target key: examples-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} - name: Get cargo-fixture - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cargo-fixture path: ~/.cargo/bin @@ -238,15 +207,9 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@v3 - - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/.crates.toml @@ -258,7 +221,7 @@ jobs: examples/http/target key: examples-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} - name: Get cargo-fixture - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cargo-fixture-exe path: ~/.cargo/bin