Skip to content

Commit 776947d

Browse files
ShaharNavehCopilot
authored andcommitted
Resolve shellcheck warning on ci.yaml (#7501)
1 parent fcc3787 commit 776947d

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ jobs:
251251
shell: bash
252252
run: |
253253
cores=$(python -c 'print(__import__("os").process_cpu_count())')
254-
echo "cores=${cores}" >> $GITHUB_OUTPUT
254+
echo "cores=${cores}" >> "$GITHUB_OUTPUT"
255255
256256
- name: Run CPython tests
257257
run: |
@@ -270,28 +270,32 @@ jobs:
270270
- name: run cpython tests to check if env polluters have stopped polluting
271271
shell: bash
272272
run: |
273-
for thing in ${{ join(matrix.env_polluting_tests, ' ') }}; do
273+
IFS=' ' read -r -a target_array <<< "$TARGETS"
274+
275+
for thing in "${target_array[@]}"; do
274276
for i in $(seq 1 10); do
275277
set +e
276-
target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing}
278+
target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v "${thing}"
277279
exit_code=$?
278280
set -e
279-
if [ ${exit_code} -eq 3 ]; then
281+
if [ "${exit_code}" -eq 3 ]; then
280282
echo "Test ${thing} polluted the environment on attempt ${i}."
281283
break
282284
fi
283285
done
284-
if [ ${exit_code} -ne 3 ]; then
286+
if [ "${exit_code}" -ne 3 ]; then
285287
echo "Test ${thing} is no longer polluting the environment after ${i} attempts!"
286288
echo "Please remove ${thing} from matrix.env_polluting_tests in '.github/workflows/ci.yaml'."
287289
echo "Please also remove the skip decorators that include the word 'POLLUTERS' in ${thing}."
288-
if [ ${exit_code} -ne 0 ]; then
290+
if [ "${exit_code}" -ne 0 ]; then
289291
echo "Test ${thing} failed with exit code ${exit_code}."
290292
echo "Please investigate which test item in ${thing} is failing and either mark it as an expected failure or a skip."
291293
fi
292294
exit 1
293295
fi
294296
done
297+
env:
298+
TARGETS: ${{ join(matrix.env_polluting_tests, ' ') }}
295299
timeout-minutes: 15
296300

297301
- if: runner.os != 'Windows'
@@ -504,9 +508,9 @@ jobs:
504508
- name: build rustpython
505509
run: cargo build --release --target wasm32-wasip1 --features freeze-stdlib,stdlib --verbose
506510
- name: run snippets
507-
run: wasmer run --dir $(pwd) target/wasm32-wasip1/release/rustpython.wasm -- "$(pwd)/extra_tests/snippets/stdlib_random.py"
511+
run: wasmer run --dir "$(pwd)" target/wasm32-wasip1/release/rustpython.wasm -- "$(pwd)/extra_tests/snippets/stdlib_random.py"
508512
- name: run cpython unittest
509-
run: wasmer run --dir $(pwd) target/wasm32-wasip1/release/rustpython.wasm -- "$(pwd)/Lib/test/test_int.py"
513+
run: wasmer run --dir "$(pwd)" target/wasm32-wasip1/release/rustpython.wasm -- "$(pwd)/Lib/test/test_int.py"
510514

511515
cargo-shear:
512516
name: cargo shear

0 commit comments

Comments
 (0)