about summary refs log tree commit diff
path: root/src/ci
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2024-04-23 08:59:45 +0200
committerJakub Beránek <berykubik@gmail.com>2024-04-23 09:01:51 +0200
commit2632c6139d9b1a7ca7be4da1924e7a78edfa452c (patch)
tree59656bd29d79340ebba30930d35fa387d4de9a63 /src/ci
parent162892b030b95aa8ad422212a82457d940b15a4b (diff)
downloadrust-2632c6139d9b1a7ca7be4da1924e7a78edfa452c.tar.gz
rust-2632c6139d9b1a7ca7be4da1924e7a78edfa452c.zip
Fix empty job matrix
Diffstat (limited to 'src/ci')
-rw-r--r--src/ci/github-actions/ci.yml8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml
index 1efdd7e22e9..19d6b517552 100644
--- a/src/ci/github-actions/ci.yml
+++ b/src/ci/github-actions/ci.yml
@@ -373,6 +373,14 @@ jobs:
       matrix:
         # Check the `calculate_matrix` job to see how is the matrix defined.
         include: ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}
+    # GitHub Actions fails the workflow if an empty list of jobs is provided to
+    # the workflow, so we need to skip this job if nothing was produced by
+    # the Python script.
+    #
+    # Unfortunately checking whether a list is empty is not possible in a nice
+    # way due to GitHub Actions expressions limits.
+    # This hack is taken from https://github.com/ferrocene/ferrocene/blob/d43edc6b7697cf1719ec1c17c54904ab94825763/.github/workflows/release.yml#L75-L82
+    if: fromJSON(needs.calculate_matrix.outputs.jobs)[0] != null
 
   master:
     name: master