Skip to content

Commit 3905db1

Browse files
committed
Refine bool comparison
1 parent 7cc677f commit 3905db1

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.github/workflows/run-examples-prep.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
3939
# Run tests if there are modified PDL files
4040
- name: Check if update results automatically by GitHub Actions Bot
41-
if: ${{ !env.early-stop }}
41+
if: ${{ env.early-stop == 'false' }}
4242
id: parse-run-examples-config
4343
shell: bash
4444
run: |
@@ -48,7 +48,7 @@ jobs:
4848
4949
# Set up Ollama
5050
- name: Cache Ollama model files
51-
if: ${{ !env.early-stop }}
51+
if: ${{ env.early-stop == 'false' }}
5252
uses: actions/cache@v4
5353
with:
5454
path: /usr/share/ollama/.ollama/models
@@ -57,17 +57,17 @@ jobs:
5757
${{ runner.os }}-build-
5858
${{ runner.os }}
5959
- uses: ./.github/actions/ollama
60-
if: ${{ !env.early-stop }}
60+
if: ${{ env.early-stop == 'false' }}
6161

6262
# Set up Run Examples environment
6363
- name: Set up Python ${{ matrix.python-version }}
6464
uses: actions/setup-python@v5
65-
if: ${{ !env.early-stop }}
65+
if: ${{ env.early-stop == 'false' }}
6666
with:
6767
python-version: ${{ matrix.python-version }}
6868
- name: Cache pip
6969
uses: actions/cache@v4
70-
if: ${{ !env.early-stop }}
70+
if: ${{ env.early-stop == 'false' }}
7171
with:
7272
# This path is specific to Ubuntu
7373
path: ${{ env.pythonLocation }}
@@ -77,19 +77,19 @@ jobs:
7777
${{ runner.os }}-pip-new3
7878
${{ runner.os }}-new3
7979
- name: Install dependencies
80-
if: ${{ !env.early-stop }}
80+
if: ${{ env.early-stop == 'false' }}
8181
shell: bash
8282
run: pip install --upgrade --upgrade-strategy eager .[all]
8383
- name: Pip list packages
84-
if: ${{ !env.early-stop }}
84+
if: ${{ env.early-stop == 'false' }}
8585
shell: bash
8686
run: pip list
8787
- name: View Run Examples config
88-
if: ${{ !env.early-stop }}
88+
if: ${{ env.early-stop == 'false' }}
8989
shell: bash
9090
run: cat tests/test_examples_run.yaml
9191
- name: Run Pytest
92-
if: ${{ !env.early-stop }}
92+
if: ${{ env.early-stop == 'false' }}
9393
shell: bash
9494
run: |
9595
(
@@ -107,7 +107,7 @@ jobs:
107107
# Commit the results if update results
108108
- name: Push new results to branch
109109
shell: bash
110-
if: ${{ !env.early-stop && env.update_results }}
110+
if: ${{ env.early-stop == 'false' && env.update_results == 'true' }}
111111
run: |
112112
git config --local user.name github-actions[bot]
113113
git config --local user.email 41898282+github-actions[bot]@users.noreply.github.com
@@ -119,12 +119,12 @@ jobs:
119119
120120
# Patch config with update_results to false and commit to PR
121121
- name: Patch tests/test_examples_run.yaml with update_results to False, only for the last job in the series
122-
if: ${{ !env.early-stop && env.update_results && matrix.python-version == '3.13' }}
122+
if: ${{ env.early-stop == 'false' && env.update_results == 'true' && matrix.python-version == '3.13' }}
123123
shell: bash
124124
run: |
125125
yq -i '.update_results = ('false')' tests/test_examples_run.yaml
126126
- name: Push the new run-examples yaml config
127-
if: ${{ !env.early-stop && env.update_results && matrix.python-version == '3.13' }}
127+
if: ${{ env.early-stop == 'false' && env.update_results == 'true' && matrix.python-version == '3.13' }}
128128
shell: bash
129129
run: |
130130
git config --local user.name github-actions[bot]
@@ -137,6 +137,7 @@ jobs:
137137
138138
- name: Check if pytest passed
139139
shell: bash
140+
if: ${{ env.early-stop == 'false' }}
140141
run: |
141142
if [ "$TEST_RESULT" == "PASSED" ]; then
142143
exit 0

0 commit comments

Comments
 (0)