From 3338611c1bafa90622ca64b38cb74e2aa485f28e Mon Sep 17 00:00:00 2001 From: Jakub Beránek Date: Fri, 25 Oct 2024 10:28:45 +0200 Subject: Switch CI from bors to merge queue --- .github/workflows/clippy.yml | 75 ------------ .github/workflows/clippy_bors.yml | 245 -------------------------------------- .github/workflows/clippy_dev.yml | 44 +++---- .github/workflows/clippy_mq.yml | 230 +++++++++++++++++++++++++++++++++++ .github/workflows/clippy_pr.yml | 64 ++++++++++ .github/workflows/remark.yml | 44 +++---- CONTRIBUTING.md | 16 +-- book/src/development/README.md | 1 - 8 files changed, 329 insertions(+), 390 deletions(-) delete mode 100644 .github/workflows/clippy.yml delete mode 100644 .github/workflows/clippy_bors.yml create mode 100644 .github/workflows/clippy_mq.yml create mode 100644 .github/workflows/clippy_pr.yml diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml deleted file mode 100644 index 0a0538490cc..00000000000 --- a/.github/workflows/clippy.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Clippy Test - -on: - push: - # Ignore bors branches, since they are covered by `clippy_bors.yml` - branches-ignore: - - auto - - try - # Don't run Clippy tests, when only text files were modified - paths-ignore: - - 'COPYRIGHT' - - 'LICENSE-*' - - '**.md' - - '**.txt' - pull_request: - # Don't run Clippy tests, when only text files were modified - paths-ignore: - - 'COPYRIGHT' - - 'LICENSE-*' - - '**.md' - - '**.txt' - -env: - RUST_BACKTRACE: 1 - CARGO_TARGET_DIR: '${{ github.workspace }}/target' - NO_FMT_TEST: 1 - CARGO_INCREMENTAL: 0 - RUSTFLAGS: -D warnings - -concurrency: - # For a given workflow, if we push to the same PR, cancel all previous builds on that PR. - # If the push is not attached to a PR, we will cancel all builds on the same branch. - group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" - cancel-in-progress: true - -jobs: - base: - # NOTE: If you modify this job, make sure you copy the changes to clippy_bors.yml - runs-on: ubuntu-latest - - steps: - # Setup - - name: Checkout - uses: actions/checkout@v4 - - - 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 }} diff --git a/.github/workflows/clippy_bors.yml b/.github/workflows/clippy_bors.yml deleted file mode 100644 index 026771e6fcf..00000000000 --- a/.github/workflows/clippy_bors.yml +++ /dev/null @@ -1,245 +0,0 @@ -name: Clippy Test (bors) - -on: - push: - branches: - - auto - - try - -env: - RUST_BACKTRACE: 1 - CARGO_TARGET_DIR: '${{ github.workspace }}/target' - NO_FMT_TEST: 1 - CARGO_INCREMENTAL: 0 - RUSTFLAGS: -D warnings - -concurrency: - # For a given workflow, if we push to the same branch, cancel all previous builds on that branch. - group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" - cancel-in-progress: true - -defaults: - run: - shell: bash - -jobs: - changelog: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} - - # Run - - name: Check Changelog - run: | - MESSAGE=$(git log --format=%B -n 1) - PR=$(echo "$MESSAGE" | grep -o "#[0-9]*" | head -1 | sed -e 's/^#//') - body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \ - python -c "import sys, json; print(json.load(sys.stdin)['body'])") - output=$(grep "^changelog:\s*\S" <<< "$body" | sed "s/changelog:\s*//g") || { - echo "ERROR: PR body must contain 'changelog: ...'" - exit 1 - } - if [[ "$output" = "none" ]]; then - echo "WARNING: changelog is 'none'" - else - echo "changelog: $output" - fi - env: - PYTHONIOENCODING: 'utf-8' - base: - needs: changelog - strategy: - matrix: - include: - - os: ubuntu-latest - host: x86_64-unknown-linux-gnu - - os: ubuntu-latest - host: i686-unknown-linux-gnu - - os: windows-latest - host: x86_64-pc-windows-msvc - - os: macos-13 - host: x86_64-apple-darwin - - runs-on: ${{ matrix.os }} - - # NOTE: If you modify this job, make sure you copy the changes to clippy.yml - steps: - # Setup - - name: Checkout - uses: actions/checkout@v4 - - - name: Install i686 dependencies - if: matrix.host == 'i686-unknown-linux-gnu' - run: | - sudo dpkg --add-architecture i386 - sudo apt-get update - sudo apt-get install gcc-multilib zlib1g-dev:i386 - - - name: Install toolchain - run: | - rustup set default-host ${{ matrix.host }} - rustup show active-toolchain - - # Run - - name: Build - run: cargo build --tests --features internal - - - name: Test - if: matrix.host == 'x86_64-unknown-linux-gnu' - run: cargo test --features internal - - - name: Test - if: matrix.host != 'x86_64-unknown-linux-gnu' - run: cargo test --features internal -- --skip dogfood - - - 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 clippy_config - run: cargo test - working-directory: clippy_config - - - 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 }} - - metadata_collection: - needs: changelog - runs-on: ubuntu-latest - - steps: - # Setup - - name: Checkout - uses: actions/checkout@v4 - - - name: Install toolchain - run: rustup show active-toolchain - - - name: Test metadata collection - run: cargo collect-metadata - - integration_build: - needs: changelog - runs-on: ubuntu-latest - - steps: - # Setup - - name: Checkout - uses: actions/checkout@v4 - - - name: Install toolchain - run: rustup show active-toolchain - - # Run - - name: Build Integration Test - env: - CARGO_PROFILE_DEV_SPLIT_DEBUGINFO: off - run: cargo test --test integration --features integration --no-run - - # Upload - - name: Extract Binaries - run: | - DIR=$CARGO_TARGET_DIR/debug - find $DIR/deps/integration-* -executable ! -type d | xargs -I {} mv {} $DIR/integration - find $DIR ! -executable -o -type d ! -path $DIR | xargs rm -rf - - - name: Upload Binaries - uses: actions/upload-artifact@v4 - with: - name: binaries - path: target/debug - - integration: - needs: integration_build - strategy: - fail-fast: false - max-parallel: 6 - matrix: - integration: - - 'matthiaskrgr/clippy_ci_panic_test' - - 'rust-lang/cargo' - - 'rust-lang/chalk' - - 'rust-lang/rustfmt' - - 'Marwes/combine' - - 'Geal/nom' - - 'rust-lang/stdarch' - - 'serde-rs/serde' - - 'chronotope/chrono' - - 'hyperium/hyper' - - 'rust-random/rand' - - 'rust-lang/futures-rs' - - 'rust-itertools/itertools' - - 'rust-lang-nursery/failure' - - 'rust-lang/log' - - runs-on: ubuntu-latest - - steps: - # Setup - - name: Checkout - uses: actions/checkout@v4 - - - name: Install toolchain - run: rustup show active-toolchain - - # Download - - name: Download target dir - uses: actions/download-artifact@v4 - with: - name: binaries - path: target/debug - - - name: Make Binaries Executable - run: chmod +x $CARGO_TARGET_DIR/debug/* - - # Run - - name: Test ${{ matrix.integration }} - run: | - TOOLCHAIN=$(rustup show active-toolchain | cut -f1 -d' ') - rustup run $TOOLCHAIN $CARGO_TARGET_DIR/debug/integration --show-output - env: - INTEGRATION: ${{ matrix.integration }} - - # These jobs doesn't actually test anything, but they're only used to tell - # bors the build completed, as there is no practical way to detect when a - # workflow is successful listening to webhooks only. - # - # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! - - end-success: - name: bors test finished - if: github.event.pusher.name == 'bors' && success() - runs-on: ubuntu-latest - needs: [changelog, base, metadata_collection, integration_build, integration] - - steps: - - name: Mark the job as successful - run: exit 0 - - end-failure: - name: bors test finished - if: github.event.pusher.name == 'bors' && (failure() || cancelled()) - runs-on: ubuntu-latest - needs: [changelog, base, metadata_collection, integration_build, integration] - - steps: - - name: Mark the job as a failure - run: exit 1 diff --git a/.github/workflows/clippy_dev.yml b/.github/workflows/clippy_dev.yml index cf0a8bde202..cefeb4fc5f9 100644 --- a/.github/workflows/clippy_dev.yml +++ b/.github/workflows/clippy_dev.yml @@ -1,10 +1,7 @@ name: Clippy Dev Test on: - push: - branches: - - auto - - try + merge_group: pull_request: # Only run on paths, that get checked by the clippy_dev tool paths: @@ -47,28 +44,21 @@ jobs: cargo check git reset --hard HEAD - # These jobs doesn't actually test anything, but they're only used to tell - # bors the build completed, as there is no practical way to detect when a - # workflow is successful listening to webhooks only. - # - # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! - - end-success: - name: bors dev test finished - if: github.event.pusher.name == 'bors' && success() - runs-on: ubuntu-latest - needs: [clippy_dev] - - steps: - - name: Mark the job as successful - run: exit 0 - - end-failure: - name: bors dev test finished - if: github.event.pusher.name == 'bors' && (failure() || cancelled()) + conclusion_dev: + needs: [ clippy_dev ] + # 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 + # when the workflow is canceled manually. + # + # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! + if: ${{ !cancelled() }} runs-on: ubuntu-latest - needs: [clippy_dev] - steps: - - name: Mark the job as a failure - run: exit 1 + # Manually check the status of all dependencies. `if: failure()` does not work. + - name: Conclusion + run: | + # Print the dependent jobs to see them in the CI log + jq -C <<< '${{ toJson(needs) }}' + # Check if all jobs that we depend on (in the needs array) were successful. + jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' diff --git a/.github/workflows/clippy_mq.yml b/.github/workflows/clippy_mq.yml new file mode 100644 index 00000000000..49622048050 --- /dev/null +++ b/.github/workflows/clippy_mq.yml @@ -0,0 +1,230 @@ +name: Clippy Test (merge queue) + +on: + merge_group: + +env: + RUST_BACKTRACE: 1 + CARGO_TARGET_DIR: '${{ github.workspace }}/target' + NO_FMT_TEST: 1 + CARGO_INCREMENTAL: 0 + RUSTFLAGS: -D warnings + +defaults: + run: + shell: bash + +jobs: + changelog: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + + # Run + - name: Check Changelog + run: | + MESSAGE=$(git log --format=%B -n 1) + PR=$(echo "$MESSAGE" | grep -o "#[0-9]*" | head -1 | sed -e 's/^#//') + body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \ + python -c "import sys, json; print(json.load(sys.stdin)['body'])") + output=$(grep "^changelog:\s*\S" <<< "$body" | sed "s/changelog:\s*//g") || { + echo "ERROR: PR body must contain 'changelog: ...'" + exit 1 + } + if [[ "$output" = "none" ]]; then + echo "WARNING: changelog is 'none'" + else + echo "changelog: $output" + fi + env: + PYTHONIOENCODING: 'utf-8' + base: + needs: changelog + strategy: + matrix: + include: + - os: ubuntu-latest + host: x86_64-unknown-linux-gnu + - os: ubuntu-latest + host: i686-unknown-linux-gnu + - os: windows-latest + host: x86_64-pc-windows-msvc + - os: macos-13 + host: x86_64-apple-darwin + + runs-on: ${{ matrix.os }} + + # NOTE: If you modify this job, make sure you copy the changes to clippy.yml + steps: + # Setup + - name: Checkout + uses: actions/checkout@v4 + + - name: Install i686 dependencies + if: matrix.host == 'i686-unknown-linux-gnu' + run: | + sudo dpkg --add-architecture i386 + sudo apt-get update + sudo apt-get install gcc-multilib zlib1g-dev:i386 + + - name: Install toolchain + run: | + rustup set default-host ${{ matrix.host }} + rustup show active-toolchain + + # Run + - name: Build + run: cargo build --tests --features internal + + - name: Test + if: matrix.host == 'x86_64-unknown-linux-gnu' + run: cargo test --features internal + + - name: Test + if: matrix.host != 'x86_64-unknown-linux-gnu' + run: cargo test --features internal -- --skip dogfood + + - 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 clippy_config + run: cargo test + working-directory: clippy_config + + - 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 }} + + metadata_collection: + needs: changelog + runs-on: ubuntu-latest + + steps: + # Setup + - name: Checkout + uses: actions/checkout@v4 + + - name: Install toolchain + run: rustup show active-toolchain + + - name: Test metadata collection + run: cargo collect-metadata + + integration_build: + needs: changelog + runs-on: ubuntu-latest + + steps: + # Setup + - name: Checkout + uses: actions/checkout@v4 + + - name: Install toolchain + run: rustup show active-toolchain + + # Run + - name: Build Integration Test + env: + CARGO_PROFILE_DEV_SPLIT_DEBUGINFO: off + run: cargo test --test integration --features integration --no-run + + # Upload + - name: Extract Binaries + run: | + DIR=$CARGO_TARGET_DIR/debug + find $DIR/deps/integration-* -executable ! -type d | xargs -I {} mv {} $DIR/integration + find $DIR ! -executable -o -type d ! -path $DIR | xargs rm -rf + + - name: Upload Binaries + uses: actions/upload-artifact@v4 + with: + name: binaries + path: target/debug + + integration: + needs: integration_build + strategy: + fail-fast: false + max-parallel: 6 + matrix: + integration: + - 'matthiaskrgr/clippy_ci_panic_test' + - 'rust-lang/cargo' + - 'rust-lang/chalk' + - 'rust-lang/rustfmt' + - 'Marwes/combine' + - 'Geal/nom' + - 'rust-lang/stdarch' + - 'serde-rs/serde' + - 'chronotope/chrono' + - 'hyperium/hyper' + - 'rust-random/rand' + - 'rust-lang/futures-rs' + - 'rust-itertools/itertools' + - 'rust-lang-nursery/failure' + - 'rust-lang/log' + + runs-on: ubuntu-latest + + steps: + # Setup + - name: Checkout + uses: actions/checkout@v4 + + - name: Install toolchain + run: rustup show active-toolchain + + # Download + - name: Download target dir + uses: actions/download-artifact@v4 + with: + name: binaries + path: target/debug + + - name: Make Binaries Executable + run: chmod +x $CARGO_TARGET_DIR/debug/* + + # Run + - name: Test ${{ matrix.integration }} + run: | + TOOLCHAIN=$(rustup show active-toolchain | cut -f1 -d' ') + rustup run $TOOLCHAIN $CARGO_TARGET_DIR/debug/integration --show-output + env: + INTEGRATION: ${{ matrix.integration }} + + conclusion: + needs: [ changelog, base, metadata_collection, integration_build, integration ] + # 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 + # when the workflow is canceled manually. + # + # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! + if: ${{ !cancelled() }} + runs-on: ubuntu-latest + steps: + # Manually check the status of all dependencies. `if: failure()` does not work. + - name: Conclusion + run: | + # Print the dependent jobs to see them in the CI log + jq -C <<< '${{ toJson(needs) }}' + # Check if all jobs that we depend on (in the needs array) were successful. + jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' diff --git a/.github/workflows/clippy_pr.yml b/.github/workflows/clippy_pr.yml new file mode 100644 index 00000000000..15752a86cf9 --- /dev/null +++ b/.github/workflows/clippy_pr.yml @@ -0,0 +1,64 @@ +name: Clippy Test + +on: + pull_request: + # Don't run Clippy tests, when only text files were modified + paths-ignore: + - 'COPYRIGHT' + - 'LICENSE-*' + - '**.md' + - '**.txt' + +env: + RUST_BACKTRACE: 1 + CARGO_TARGET_DIR: '${{ github.workspace }}/target' + NO_FMT_TEST: 1 + CARGO_INCREMENTAL: 0 + RUSTFLAGS: -D warnings + +concurrency: + # For a given workflow, if we push to the same PR, cancel all previous builds on that PR. + # If the push is not attached to a PR, we will cancel all builds on the same branch. + group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" + cancel-in-progress: true + +jobs: + base: + # NOTE: If you modify this job, make sure you copy the changes to clippy_mq.yml + runs-on: ubuntu-latest + + steps: + # Setup + - name: Checkout + uses: actions/checkout@v4 + + - 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 }} diff --git a/.github/workflows/remark.yml b/.github/workflows/remark.yml index a1b011dc32d..1c1a9e82454 100644 --- a/.github/workflows/remark.yml +++ b/.github/workflows/remark.yml @@ -1,10 +1,7 @@ name: Remark on: - push: - branches: - - auto - - try + merge_group: pull_request: paths: - '**.md' @@ -45,28 +42,21 @@ jobs: - name: Build mdbook run: mdbook build book - # These jobs doesn't actually test anything, but they're only used to tell - # bors the build completed, as there is no practical way to detect when a - # workflow is successful listening to webhooks only. - # - # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! - - end-success: - name: bors remark test finished - if: github.event.pusher.name == 'bors' && success() - runs-on: ubuntu-latest - needs: [remark] - - steps: - - name: Mark the job as successful - run: exit 0 - - end-failure: - name: bors remark test finished - if: github.event.pusher.name == 'bors' && (failure() || cancelled()) + conclusion_remark: + needs: [ remark ] + # 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 + # when the workflow is canceled manually. + # + # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! + if: ${{ !cancelled() }} runs-on: ubuntu-latest - needs: [remark] - steps: - - name: Mark the job as a failure - run: exit 1 + # Manually check the status of all dependencies. `if: failure()` does not work. + - name: Conclusion + run: | + # Print the dependent jobs to see them in the CI log + jq -C <<< '${{ toJson(needs) }}' + # Check if all jobs that we depend on (in the needs array) were successful. + jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b1a59238c82..1f6c918fc6c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,7 +21,6 @@ All contributors are expected to follow the [Rust Code of Conduct]. - [Rust Analyzer](#rust-analyzer) - [How Clippy works](#how-clippy-works) - [Issue and PR triage](#issue-and-pr-triage) - - [Bors and Homu](#bors-and-homu) - [Contributions](#contributions) - [License](#license) @@ -213,16 +212,6 @@ We have prioritization labels and a sync-blocker label, which are described belo Or rather: before the sync this should be addressed, e.g. by removing a lint again, so it doesn't hit beta/stable. -## Bors and Homu - -We use a bot powered by [Homu][homu] to help automate testing and landing of pull -requests in Clippy. The bot's username is @bors. - -You can find the Clippy bors queue [here][homu_queue]. - -If you have @bors permissions, you can find an overview of the available -commands [here][homu_instructions]. - [triage]: https://forge.rust-lang.org/release/triage-procedure.html [l-crash]: https://github.com/rust-lang/rust-clippy/labels/L-crash [l-bug]: https://github.com/rust-lang/rust-clippy/labels/L-bug @@ -230,9 +219,6 @@ commands [here][homu_instructions]. [p-medium]: https://github.com/rust-lang/rust-clippy/labels/P-medium [p-high]: https://github.com/rust-lang/rust-clippy/labels/P-high [l-sync-blocker]: https://github.com/rust-lang/rust-clippy/labels/L-sync-blocker -[homu]: https://github.com/rust-lang/homu -[homu_instructions]: https://bors.rust-lang.org/ -[homu_queue]: https://bors.rust-lang.org/queue/clippy ## Contributions @@ -244,7 +230,7 @@ All PRs should include a `changelog` entry with a short comment explaining the c "what do you believe is important from an outsider's perspective?" Often, PRs are only related to a single property of a lint, and then it's good to mention that one. Otherwise, it's better to include too much detail than too little. -Clippy's [changelog] is created from these comments. Every release, someone gets all commits from bors with a +Clippy's [changelog] is created from these comments. Every release, someone gets all merge commits with a `changelog: XYZ` entry and combines them into the changelog. This is a manual process. Examples: diff --git a/book/src/development/README.md b/book/src/development/README.md index 8f09f66f595..b33cdc00ead 100644 --- a/book/src/development/README.md +++ b/book/src/development/README.md @@ -53,7 +53,6 @@ book](../lints.md). > - IDE setup > - High level overview on how Clippy works > - Triage procedure -> - Bors and Homu [ast]: https://rustc-dev-guide.rust-lang.org/syntax-intro.html [hir]: https://rustc-dev-guide.rust-lang.org/hir.html -- cgit 1.4.1-3-g733a5 From 9ebe68d8c375eaf41c9901e8921e555f5b389539 Mon Sep 17 00:00:00 2001 From: Jakub Beránek Date: Thu, 7 Nov 2024 18:13:50 +0100 Subject: Add conclusion job to PR CI --- .github/workflows/clippy_pr.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/clippy_pr.yml b/.github/workflows/clippy_pr.yml index 15752a86cf9..8748741ba20 100644 --- a/.github/workflows/clippy_pr.yml +++ b/.github/workflows/clippy_pr.yml @@ -62,3 +62,24 @@ jobs: 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 ] + # 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 + # when the workflow is canceled manually. + # + # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! + if: ${{ !cancelled() }} + runs-on: ubuntu-latest + steps: + # Manually check the status of all dependencies. `if: failure()` does not work. + - name: Conclusion + run: | + # Print the dependent jobs to see them in the CI log + jq -C <<< '${{ toJson(needs) }}' + # Check if all jobs that we depend on (in the needs array) were successful. + jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' -- cgit 1.4.1-3-g733a5 From 843ef1b1f07820d26cbda2fc548f16f6a7a0aa58 Mon Sep 17 00:00:00 2001 From: Jakub Beránek Date: Thu, 7 Nov 2024 18:26:06 +0100 Subject: Remove path filter It would cause issues with the required jobs, and it is probably useless anyway, the vast majority of PRs seem to change Rust source files. --- .github/workflows/clippy_dev.yml | 6 ------ .github/workflows/clippy_pr.yml | 6 ------ .github/workflows/remark.yml | 2 -- 3 files changed, 14 deletions(-) diff --git a/.github/workflows/clippy_dev.yml b/.github/workflows/clippy_dev.yml index cefeb4fc5f9..bcb3193ad67 100644 --- a/.github/workflows/clippy_dev.yml +++ b/.github/workflows/clippy_dev.yml @@ -3,12 +3,6 @@ name: Clippy Dev Test on: merge_group: pull_request: - # Only run on paths, that get checked by the clippy_dev tool - paths: - - 'CHANGELOG.md' - - 'README.md' - - '**.stderr' - - '**.rs' env: RUST_BACKTRACE: 1 diff --git a/.github/workflows/clippy_pr.yml b/.github/workflows/clippy_pr.yml index 8748741ba20..2e5b5bd41df 100644 --- a/.github/workflows/clippy_pr.yml +++ b/.github/workflows/clippy_pr.yml @@ -2,12 +2,6 @@ name: Clippy Test on: pull_request: - # Don't run Clippy tests, when only text files were modified - paths-ignore: - - 'COPYRIGHT' - - 'LICENSE-*' - - '**.md' - - '**.txt' env: RUST_BACKTRACE: 1 diff --git a/.github/workflows/remark.yml b/.github/workflows/remark.yml index 1c1a9e82454..0d402fe7064 100644 --- a/.github/workflows/remark.yml +++ b/.github/workflows/remark.yml @@ -3,8 +3,6 @@ name: Remark on: merge_group: pull_request: - paths: - - '**.md' jobs: remark: -- cgit 1.4.1-3-g733a5