From 2b1fe7b6418fb58bec742b1b4332e75549d48ece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Tue, 22 Oct 2024 15:35:33 +0200 Subject: [PATCH 1/5] Switch CI from bors to merge queue --- .github/workflows/{bors.yml => ci.yml} | 45 ++++++++++---------------- 1 file changed, 17 insertions(+), 28 deletions(-) rename .github/workflows/{bors.yml => ci.yml} (79%) diff --git a/.github/workflows/bors.yml b/.github/workflows/ci.yml similarity index 79% rename from .github/workflows/bors.yml rename to .github/workflows/ci.yml index 28e07540..a0f4bc07 100644 --- a/.github/workflows/bors.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,6 @@ -name: bors build +name: CI on: - push: - branches: - - try - - auto + merge_group: jobs: lint: @@ -122,29 +119,21 @@ jobs: aws_secret_access_key: "${{ secrets.aws_secret_access_key }}" if: github.ref == 'refs/heads/auto' - - # 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 NEEDS TO BE ADDED TO THE `needs` SECTION OF THIS JOB! - - end-success: - name: bors build finished - if: success() - runs-on: ubuntu-latest + conclusion: needs: [docker-upload] - - steps: - - name: Mark the job as successful - run: exit 0 - - end-failure: - name: bors build finished - if: "!success()" + # 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: [docker-upload] - 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) }}' From 5ec12235aa235804731ca77b87d31f74aa834220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 31 Oct 2024 12:13:44 +0100 Subject: [PATCH 2/5] Add conclusion job to PR builds --- .github/workflows/pr.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4a203c32..a0f4748c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -38,3 +38,24 @@ jobs: run: | cargo run -- create-lists cargo test + + # Note: this job is used so that there is a job named "conclusion" both in the PR and merge queue + # CI. Otherwise, it would not be possible for PR CI to succeed. + conclusion: + needs: [lint, test] + # 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) }}' From 1f52c297f1dadd18a965a00cce90c26b9843f339 Mon Sep 17 00:00:00 2001 From: MarcoIeni <11428655+MarcoIeni@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:47:56 +0100 Subject: [PATCH 3/5] pin nightly version --- .github/workflows/ci.yml | 9 ++++++--- rust-toolchain | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0f4bc07..1e057646 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,9 @@ name: CI on: merge_group: +env: + CHANNEL: nightly-2024-10-07 + jobs: lint: name: Linting @@ -10,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust nightly - run: rustup update nightly && rustup default nightly && rustup component add rustfmt clippy + run: rustup install ${{ env.CHANNEL }} && rustup default ${{ env.CHANNEL }} && rustup component add rustfmt clippy - name: Check the code formatting with rustfmt run: cargo fmt --all -- --check @@ -28,7 +31,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - channel: [nightly] + channel: [nightly-2024-10-07] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -59,7 +62,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust nightly - run: rustup update --no-self-update nightly && rustup default nightly + run: rustup install ${{ env.CHANNEL }} && rustup default ${{ env.CHANNEL }} - name: Run minicrater shell: bash diff --git a/rust-toolchain b/rust-toolchain index bf867e0a..f6311cce 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly +nightly-2024-10-07 From 991fd727049efb4313e3e89146c253d43f4c3dca Mon Sep 17 00:00:00 2001 From: MarcoIeni <11428655+MarcoIeni@users.noreply.github.com> Date: Thu, 7 Nov 2024 14:28:14 +0100 Subject: [PATCH 4/5] Revert "pin nightly version" This reverts commit 1f52c297f1dadd18a965a00cce90c26b9843f339. --- .github/workflows/ci.yml | 9 +++------ rust-toolchain | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e057646..a0f4bc07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,6 @@ name: CI on: merge_group: -env: - CHANNEL: nightly-2024-10-07 - jobs: lint: name: Linting @@ -13,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust nightly - run: rustup install ${{ env.CHANNEL }} && rustup default ${{ env.CHANNEL }} && rustup component add rustfmt clippy + run: rustup update nightly && rustup default nightly && rustup component add rustfmt clippy - name: Check the code formatting with rustfmt run: cargo fmt --all -- --check @@ -31,7 +28,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - channel: [nightly-2024-10-07] + channel: [nightly] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -62,7 +59,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust nightly - run: rustup install ${{ env.CHANNEL }} && rustup default ${{ env.CHANNEL }} + run: rustup update --no-self-update nightly && rustup default nightly - name: Run minicrater shell: bash diff --git a/rust-toolchain b/rust-toolchain index f6311cce..bf867e0a 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2024-10-07 +nightly From ba50a0c618583626a46da9fbfd7c642e67c3322a Mon Sep 17 00:00:00 2001 From: MarcoIeni <11428655+MarcoIeni@users.noreply.github.com> Date: Thu, 7 Nov 2024 14:33:33 +0100 Subject: [PATCH 5/5] update errors --- .../full/full.html.context.expected.json | 22 +------------------ .../full/index.html.context.expected.json | 22 +------------------ .../full/markdown.md.context.expected.json | 2 +- tests/minicrater/full/results.expected.json | 2 +- 4 files changed, 4 insertions(+), 44 deletions(-) diff --git a/tests/minicrater/full/full.html.context.expected.json b/tests/minicrater/full/full.html.context.expected.json index 9332f320..ddb108a5 100644 --- a/tests/minicrater/full/full.html.context.expected.json +++ b/tests/minicrater/full/full.html.context.expected.json @@ -15,7 +15,7 @@ 0, { "RootResults": { - "count": 4, + "count": 3, "results": { "build ICE": [ { @@ -57,26 +57,6 @@ "url": "https://github.com/rust-lang/crater/tree/master/local-crates/error-code" } ], - "build compiler-error(E0658)": [ - { - "color_idx": 0, - "name": "error-code (local)", - "res": "regressed", - "runs": [ - { - "color_idx": 7, - "log": "stable/local/error-code", - "name_idx": 0 - }, - { - "color_idx": 0, - "log": "beta/local/error-code", - "name_idx": 2 - } - ], - "url": "https://github.com/rust-lang/crater/tree/master/local-crates/error-code" - } - ], "build failed (unknown)": [ { "color_idx": 0, diff --git a/tests/minicrater/full/index.html.context.expected.json b/tests/minicrater/full/index.html.context.expected.json index 9d4a83bc..18535b78 100644 --- a/tests/minicrater/full/index.html.context.expected.json +++ b/tests/minicrater/full/index.html.context.expected.json @@ -15,7 +15,7 @@ 0, { "RootResults": { - "count": 4, + "count": 3, "results": { "build ICE": [ { @@ -57,26 +57,6 @@ "url": "https://github.com/rust-lang/crater/tree/master/local-crates/error-code" } ], - "build compiler-error(E0658)": [ - { - "color_idx": 0, - "name": "error-code (local)", - "res": "regressed", - "runs": [ - { - "color_idx": 7, - "log": "stable/local/error-code", - "name_idx": 0 - }, - { - "color_idx": 0, - "log": "beta/local/error-code", - "name_idx": 2 - } - ], - "url": "https://github.com/rust-lang/crater/tree/master/local-crates/error-code" - } - ], "build failed (unknown)": [ { "color_idx": 0, diff --git a/tests/minicrater/full/markdown.md.context.expected.json b/tests/minicrater/full/markdown.md.context.expected.json index 8f0b3315..f7c639eb 100644 --- a/tests/minicrater/full/markdown.md.context.expected.json +++ b/tests/minicrater/full/markdown.md.context.expected.json @@ -62,7 +62,7 @@ }, { "log": "beta/local/error-code", - "res": "build-fail:compiler-error(E0015, E0658)" + "res": "build-fail:compiler-error(E0015)" } ], "url": "https://github.com/rust-lang/crater/tree/master/local-crates/error-code" diff --git a/tests/minicrater/full/results.expected.json b/tests/minicrater/full/results.expected.json index 77fa7374..d3f70a5f 100644 --- a/tests/minicrater/full/results.expected.json +++ b/tests/minicrater/full/results.expected.json @@ -157,7 +157,7 @@ }, { "log": "beta/local/error-code", - "res": "build-fail:compiler-error(E0015, E0658)" + "res": "build-fail:compiler-error(E0015)" } ], "url": "https://github.com/rust-lang/crater/tree/master/local-crates/error-code"