From e3ead430a7f22f951fb3888cf9bedda518c800e2 Mon Sep 17 00:00:00 2001 From: MarcoIeni <11428655+MarcoIeni@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:55:29 +0100 Subject: [PATCH 1/3] use merge queue --- .github/workflows/doc.yml | 25 +++++++++++++++++++++++++ .github/workflows/main.yml | 15 +-------------- 2 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/doc.yml diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml new file mode 100644 index 0000000000..d2887b369a --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,25 @@ +name: Docs + +on: + push: + branches: + - master + +jobs: + docs: + name: Publish Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust + run: rustup update nightly --no-self-update && rustup default nightly + - run: ci/dox.sh + env: + CI: 1 + - name: Publish documentation + run: | + cd target/doc + git init + git add . + git -c user.name='ci' -c user.email='ci' commit -m init + git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6fa886f15c..6701cf52f0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,12 +1,7 @@ name: CI on: - push: - branches: - - auto - - try pull_request: - branches: - - master + merge_group: jobs: style: @@ -29,14 +24,6 @@ jobs: - run: ci/dox.sh env: CI: 1 - - name: Publish documentation - run: | - cd target/doc - git init - git add . - git -c user.name='ci' -c user.email='ci' commit -m init - git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages - if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' verify: name: Automatic intrinsic verification From 5e21410b0264603bbbf589a5926029a66222ff70 Mon Sep 17 00:00:00 2001 From: MarcoIeni <11428655+MarcoIeni@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:16:24 +0100 Subject: [PATCH 2/3] add conclusion job --- .github/workflows/main.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6701cf52f0..7fb36fe7bb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -233,7 +233,7 @@ jobs: run: rustup update nightly && rustup default nightly - run: ./ci/build-std-detect.sh - success: + conclusion: needs: - docs - verify @@ -241,11 +241,17 @@ jobs: - test - build-std-detect runs-on: ubuntu-latest - # GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency - # failed" as success. So we have to do some contortions to ensure the job fails if any of its - # dependencies fails. - if: always() # make sure this is never "skipped" + # 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() }} # make sure this is never "skipped" steps: - # Manually check the status of all dependencies. `if: failure()` does not work. - - name: check if any dependency failed - run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' + - 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 b200c7c2d56301bf8c380c21f6bed2f1e506e752 Mon Sep 17 00:00:00 2001 From: MarcoIeni <11428655+MarcoIeni@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:17:46 +0100 Subject: [PATCH 3/3] remove docs publishing --- .github/workflows/doc.yml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .github/workflows/doc.yml diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml deleted file mode 100644 index d2887b369a..0000000000 --- a/.github/workflows/doc.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Docs - -on: - push: - branches: - - master - -jobs: - docs: - name: Publish Documentation - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Rust - run: rustup update nightly --no-self-update && rustup default nightly - - run: ci/dox.sh - env: - CI: 1 - - name: Publish documentation - run: | - cd target/doc - git init - git add . - git -c user.name='ci' -c user.email='ci' commit -m init - git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages