From be30fccee87f6c6c3d3c75b631693936f30a54a8 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Wed, 30 Oct 2024 10:14:44 +0100 Subject: [PATCH] Run CI checks for Rust 2024 as well --- .github/workflows/clippy_pr.yml | 52 +++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/.github/workflows/clippy_pr.yml b/.github/workflows/clippy_pr.yml index 2e5b5bd41dfb..902bed08d60a 100644 --- a/.github/workflows/clippy_pr.yml +++ b/.github/workflows/clippy_pr.yml @@ -57,10 +57,58 @@ jobs: env: OS: ${{ runner.os }} - # We need to have the "conclusion" job also on PR CI, to make it possible + base-2024: + runs-on: ubuntu-latest + + steps: + # Setup + - name: Checkout + uses: actions/checkout@v4 + + - name: Select Rust 2024 edition + run: | + for i in clippy_config clippy_dev clippy_lints clippy_utils lintcheck; do + sed -i \ + -e '1icargo-features = ["edition2024"]' \ + -e 's/edition = "2021"/edition = "2024"/' \ + $i/Cargo.toml + done + + - name: Install toolchain + run: rustup show active-toolchain + + # Run + - name: Build + run: cargo build --tests --features internal + + - name: Test + run: cargo test --features internal + + - name: Test clippy_lints + run: cargo test --features internal + working-directory: clippy_lints + + - name: Test clippy_utils + run: cargo test + working-directory: clippy_utils + + - name: Test rustc_tools_util + run: cargo test + working-directory: rustc_tools_util + + - name: Test clippy_dev + run: cargo test + working-directory: clippy_dev + + - name: Test clippy-driver + run: .github/driver.sh + env: + OS: ${{ runner.os }} + +# We need to have the "conclusion" job also on PR CI, to make it possible # to add PRs to a merge queue. conclusion: - needs: [ base ] + needs: [ base, base-2024 ] # We need to ensure this job does *not* get skipped if its dependencies fail, # because a skipped job is considered a success by GitHub. So we have to # overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run