about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/.github/workflows/release.yml
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_codegen_gcc/.github/workflows/release.yml')
-rw-r--r--compiler/rustc_codegen_gcc/.github/workflows/release.yml25
1 files changed, 23 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_gcc/.github/workflows/release.yml b/compiler/rustc_codegen_gcc/.github/workflows/release.yml
index 886ce90b471..47a40286554 100644
--- a/compiler/rustc_codegen_gcc/.github/workflows/release.yml
+++ b/compiler/rustc_codegen_gcc/.github/workflows/release.yml
@@ -1,8 +1,10 @@
 name: CI with sysroot compiled in release mode
 
 on:
-  - push
-  - pull_request
+  push:
+    branches:
+      - master
+  pull_request:
 
 permissions:
   contents: read
@@ -82,3 +84,22 @@ jobs:
           echo "Test is done with LTO enabled, hence inlining should occur across crates"
           exit 1
         fi
+
+  # Summary job for the merge queue.
+  # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
+  success_release:
+    needs: [build]
+    # 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.
+    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) }}'