From 9392d433d051d038a09869eee2f87cd2fd48ae62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sviatoslav=20Sydorenko=20=28=D0=A1=D0=B2=D1=8F=D1=82=D0=BE?= =?UTF-8?q?=D1=81=D0=BB=D0=B0=D0=B2=20=D0=A1=D0=B8=D0=B4=D0=BE=D1=80=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE=29?= Date: Tue, 16 Jul 2024 14:50:30 +0200 Subject: [PATCH] =?UTF-8?q?[3.12]=20=F0=9F=A7=AA=F0=9F=9A=91=20Fix=20using?= =?UTF-8?q?=20`check=5Fsource`=20flags=20as=20bool=20(GH-121848).=20(cherr?= =?UTF-8?q?y=20picked=20from=20commit=20a0b205bba555dd9c702b9a856cd9a81532?= =?UTF-8?q?77c9b0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) --- .github/workflows/build.yml | 26 +++++++++++++++++++++++--- .github/workflows/reusable-windows.yml | 1 + 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf3e268f0213b9..a3f8ed1e2fe56c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/reusable-windows.yml b/.github/workflows/reusable-windows.yml index 41f2c2b0c2cd25..de30c980e22f86 100644 --- a/.github/workflows/reusable-windows.yml +++ b/.github/workflows/reusable-windows.yml @@ -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