From 301049048ad603a3a4264af7fa02b95cbaa795c2 Mon Sep 17 00:00:00 2001 From: Christian Meissl Date: Fri, 30 Aug 2024 18:26:14 +0200 Subject: [PATCH] CI: upgrade actions --- .github/workflows/ci.yml | 85 +++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 49 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1865ea..3e64076 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,15 +13,9 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - profile: minimal - components: rustfmt - default: true + uses: dtolnay/rust-toolchain@stable - name: Cargo cache uses: actions/cache@v2 with: @@ -30,6 +24,7 @@ jobs: ~/.cargo/git key: ${{ runner.os }}-cargo-rust_stable-${{ hashFiles('**/Cargo.toml') }} - name: Format + run: cargo fmt --all -- --check uses: actions-rs/cargo@v1 with: command: fmt @@ -37,21 +32,13 @@ jobs: clippy-check: runs-on: ubuntu-24.04 - strategy: - fail-fast: false - matrix: - rust: ['1.65.0', 'stable', 'beta'] steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true - profile: minimal components: clippy - default: true - name: Cargo cache uses: actions/cache@v2 with: @@ -67,10 +54,7 @@ jobs: - name: System dependencies run: sudo apt-get update; sudo apt-get install libdisplay-info-dev - name: Clippy - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all --all-features --all-targets -- -D warnings + run: cargo clippy --all --all-features --all-targets -- -D warnings check-minimal: env: @@ -79,16 +63,11 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive - name: Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: true - profile: minimal - default: true + uses: dtolnay/rust-toolchain@nightly - name: Cargo cache uses: actions/cache@v2 with: @@ -99,15 +78,33 @@ jobs: - name: System dependencies run: sudo apt-get update; sudo apt-get install libdisplay-info-dev - name: Downgrade to minimal dependencies - uses: actions-rs/cargo@v1 - with: - command: update - args: -Z minimal-versions + run: cargo update -Z minimal-versions - name: Check - uses: actions-rs/cargo@v1 + run: cargo check --all + + check-msrv: + env: + RUSTFLAGS: "-D warnings" + + runs-on: ubuntu-24.04 + steps: + - name: Checkout sources + uses: actions/checkout@v4 with: - command: check - args: --all + submodules: recursive + - name: Rust toolchain + uses: dtolnay/rust-toolchain@1.65 + - name: Cargo cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + key: ${{ runner.os }}-cargo-rust_nightly-${{ hashFiles('**/Cargo.toml') }} + - name: System dependencies + run: sudo apt-get update; sudo apt-get install libdisplay-info-dev + - name: Check + run: cargo check --all test: needs: @@ -125,7 +122,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cargo cache uses: actions/cache@v2 with: @@ -134,12 +131,7 @@ jobs: ~/.cargo/git key: ${{ runner.os }}-cargo-rust_stable-${{ hashFiles('**/Cargo.toml') }} - name: Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - default: true - profile: minimal + uses: dtolnay/rust-toolchain@stable - name: System dependencies run: sudo apt-get update; sudo apt-get install libdisplay-info-dev - name: Build cache @@ -148,9 +140,4 @@ jobs: path: target key: ${{ runner.os }}-build-rust_stable-smithay-feature_${{ matrix.features }}-${{ hashFiles('**/Cargo.toml') }} - name: Test features - uses: actions-rs/cargo@v1 - env: - RUST_BACKTRACE: full - with: - command: test - args: --no-default-features --features "${{ matrix.features }}" \ No newline at end of file + run: cargo test --no-default-features --features "${{ matrix.features }}" \ No newline at end of file