summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorSviatoslav Sydorenko (Святослав Сидоренко) <wk@sydorenko.org.ua>2024-07-16 12:50:30 (GMT)
committerGitHub <noreply@github.com>2024-07-16 12:50:30 (GMT)
commita0b205bba555dd9c702b9a856cd9a8153277c9b0 (patch)
tree3f94e68cf198b94a6618b9c2bd5e0454390ff216 /.github
parentf27593a87c344f3774ca73644a11cbd5614007ef (diff)
downloadcpython-a0b205bba555dd9c702b9a856cd9a8153277c9b0.zip
cpython-a0b205bba555dd9c702b9a856cd9a8153277c9b0.tar.gz
cpython-a0b205bba555dd9c702b9a856cd9a8153277c9b0.tar.bz2
🧪🚑 Fix using `check_source` flags as bool (#121848)
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build.yml28
-rw-r--r--.github/workflows/reusable-windows.yml2
2 files changed, 25 insertions, 5 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e1d9e16..0298d04 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -27,11 +27,31 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
+ # Some of the referenced steps set outputs conditionally and there may be
+ # cases when referencing them evaluates to empty strings. It is nice to
+ # work with proper booleans so they have to be evaluated through JSON
+ # conversion in the expressions. However, empty strings used like that
+ # may trigger all sorts of undefined and hard-to-debug behaviors in
+ # GitHub Actions CI/CD. To help with this, all of the outputs set here
+ # that are meant to be used as boolean flags (and not arbitrary strings),
+ # MUST have fallbacks with default values set. A common pattern would be
+ # to add ` || false` to all such expressions here, in the output
+ # definitions. They can then later be safely used through the following
+ # idiom in job conditionals and other expressions. Here's some examples:
+ #
+ # if: fromJSON(needs.check_source.outputs.run-docs)
+ #
+ # ${{
+ # fromJSON(needs.check_source.outputs.run_tests)
+ # && 'truthy-branch'
+ # || 'falsy-branch'
+ # }}
+ #
run-docs: ${{ steps.docs-changes.outputs.run-docs || false }}
- run_tests: ${{ steps.check.outputs.run_tests }}
- run_hypothesis: ${{ steps.check.outputs.run_hypothesis }}
- run_cifuzz: ${{ steps.check.outputs.run_cifuzz }}
- config_hash: ${{ steps.config_hash.outputs.hash }}
+ run_tests: ${{ steps.check.outputs.run_tests || false }}
+ run_hypothesis: ${{ steps.check.outputs.run_hypothesis || false }}
+ run_cifuzz: ${{ steps.check.outputs.run_cifuzz || false }}
+ config_hash: ${{ steps.config_hash.outputs.hash }} # str
steps:
- uses: actions/checkout@v4
- name: Check for source changes
diff --git a/.github/workflows/reusable-windows.yml b/.github/workflows/reusable-windows.yml
index 94a3abe..e9c3c8e 100644
--- a/.github/workflows/reusable-windows.yml
+++ b/.github/workflows/reusable-windows.yml
@@ -6,7 +6,7 @@ on:
required: true
type: string
free-threading:
- description: Whether to use no-GIL mode
+ description: Whether to compile CPython in free-threading mode
required: false
type: boolean
default: false