Skip to content

Commit

Permalink
[3.12] Fix using check_source flags as bool (pythonGH-121848) (pyth…
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Jul 16, 2024
1 parent 106d645 commit 61d5e87
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,30 @@ 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 }}
config_hash: ${{ steps.config_hash.outputs.hash }}
run_tests: ${{ steps.check.outputs.run_tests || false }}
run_hypothesis: ${{ steps.check.outputs.run_hypothesis || false }}
config_hash: ${{ steps.config_hash.outputs.hash }} # str
steps:
- uses: actions/checkout@v4
- name: Check for source changes
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ on:
workflow_call:
inputs:
free-threading:
description: Whether to compile CPython in free-threading mode
required: false
type: boolean
default: false
Expand Down

0 comments on commit 61d5e87

Please sign in to comment.