Skip to content

Commit ec6f532

Browse files
committed
cleanup ci.yaml
1 parent 5c726e1 commit ec6f532

1 file changed

Lines changed: 40 additions & 99 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 40 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,6 @@ env:
2323
# - rustpython-compiler-source: deprecated
2424
# - rustpython-venvlauncher: Windows-only
2525
WORKSPACE_EXCLUDES: --exclude rustpython_wasm --exclude rustpython-compiler-source --exclude rustpython-venvlauncher
26-
# Skip additional tests on Windows. They are checked on Linux and MacOS.
27-
# test_glob: many failing tests
28-
# test_pathlib: panic by surrogate chars
29-
# test_posixpath: OSError: (22, 'The filename, directory name, or volume label syntax is incorrect. (os error 123)')
30-
# test_venv: couple of failing tests
31-
WINDOWS_SKIPS: >-
32-
test_rlcompleter
33-
test_pathlib
34-
test_posixpath
35-
test_venv
3626
# PLATFORM_INDEPENDENT_TESTS are tests that do not depend on the underlying OS. They are currently
3727
# only run on Linux to speed up the CI.
3828
PLATFORM_INDEPENDENT_TESTS: >-
@@ -107,10 +97,6 @@ env:
10797
test_unpack_ex
10898
test_weakref
10999
test_yield_from
110-
ENV_POLLUTING_TESTS_COMMON: >-
111-
ENV_POLLUTING_TESTS_LINUX: >-
112-
ENV_POLLUTING_TESTS_MACOS: >-
113-
ENV_POLLUTING_TESTS_WINDOWS: >-
114100
# Python version targeted by the CI.
115101
PYTHON_VERSION: "3.14.3"
116102
X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR: C:\Program Files\OpenSSL\lib\VC\x64\MD
@@ -290,67 +276,74 @@ jobs:
290276
env:
291277
RUST_BACKTRACE: full
292278
name: Run snippets and cpython tests
293-
runs-on: ${{ matrix.os }}
279+
runs-on: ${{ matrix.platform.os }}
294280
strategy:
295281
matrix:
296-
os: [macos-latest, ubuntu-latest, windows-2025]
282+
platform:
283+
- os: macos-latest
284+
env_polluting_tests: ""
285+
skips: ""
286+
- os: ubuntu-latest
287+
env_polluting_tests: ""
288+
skips: ""
289+
- os: windows-2025
290+
env_polluting_tests: ""
291+
# Skip additional tests on Windows. They are checked on Linux and MacOS.
292+
# test_pathlib: panic by surrogate chars
293+
# test_posixpath: OSError: (22, 'The filename, directory name, or volume label syntax is incorrect. (os error 123)')
294+
# test_venv: couple of failing tests
295+
skips: >-
296+
test_rlcompleter
297+
test_pathlib
298+
test_posixpath
299+
test_venv
297300
fail-fast: false
298301
steps:
299302
- uses: actions/checkout@v6.0.2
303+
300304
- uses: dtolnay/rust-toolchain@stable
305+
301306
- uses: Swatinem/rust-cache@v2
307+
302308
- uses: actions/setup-python@v6.2.0
303309
with:
304310
python-version: ${{ env.PYTHON_VERSION }}
311+
305312
- name: Set up the Mac environment
306313
run: brew install autoconf automake libtool openssl@3
307314
if: runner.os == 'macOS'
315+
308316
- name: build rustpython
309317
run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }}
310318
if: runner.os == 'macOS'
319+
311320
- name: build rustpython
312321
run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }},jit
313322
if: runner.os != 'macOS'
314-
- uses: actions/setup-python@v6.2.0
315-
with:
316-
python-version: ${{ env.PYTHON_VERSION }}
323+
317324
- name: run snippets
318325
run: python -m pip install -r requirements.txt && pytest -v
319326
working-directory: ./extra_tests
320327

321-
- if: runner.os == 'Linux'
322-
name: run cpython platform-independent tests
328+
- name: Run CPython platform-independent tests
329+
run: |
330+
target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v ${{ env.PLATFORM_INDEPENDENT_TESTS }}
323331
env:
324332
RUSTPYTHON_SKIP_ENV_POLLUTERS: true
325-
run: target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v ${{ env.PLATFORM_INDEPENDENT_TESTS }}
326333
timeout-minutes: 45
334+
if: runner.os == 'Linux'
327335

328-
- if: runner.os == 'Linux'
329-
name: run cpython platform-dependent tests (Linux)
336+
- name: Run CPython platform-dependent tests
337+
run: |
338+
target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ matrix.target.skips }}
330339
env:
331340
RUSTPYTHON_SKIP_ENV_POLLUTERS: true
332-
run: target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }}
333341
timeout-minutes: 60
334342

335-
- if: runner.os == 'macOS'
336-
name: run cpython platform-dependent tests (MacOS)
337-
env:
338-
RUSTPYTHON_SKIP_ENV_POLLUTERS: true
339-
run: target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }}
340-
timeout-minutes: 50
341-
342-
- if: runner.os == 'Windows'
343-
name: run cpython platform-dependent tests (windows partial - fixme)
344-
env:
345-
RUSTPYTHON_SKIP_ENV_POLLUTERS: true
346-
run: target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.WINDOWS_SKIPS }}
347-
timeout-minutes: 50
348-
349-
- if: runner.os == 'Linux'
350-
name: run cpython tests to check if env polluters have stopped polluting (Common/Linux)
343+
- name: Run cpython tests to check if env polluters have stopped polluting
351344
shell: bash
352345
run: |
353-
for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_LINUX }}; do
346+
for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ matrix.platform.env_polluting_tests }}; do
354347
for i in $(seq 1 10); do
355348
set +e
356349
target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing}
@@ -363,63 +356,7 @@ jobs:
363356
done
364357
if [ ${exit_code} -ne 3 ]; then
365358
echo "Test ${thing} is no longer polluting the environment after ${i} attempts!"
366-
echo "Please remove ${thing} from either ENV_POLLUTING_TESTS_COMMON or ENV_POLLUTING_TESTS_LINUX in '.github/workflows/ci.yaml'."
367-
echo "Please also remove the skip decorators that include the word 'POLLUTERS' in ${thing}."
368-
if [ ${exit_code} -ne 0 ]; then
369-
echo "Test ${thing} failed with exit code ${exit_code}."
370-
echo "Please investigate which test item in ${thing} is failing and either mark it as an expected failure or a skip."
371-
fi
372-
exit 1
373-
fi
374-
done
375-
timeout-minutes: 15
376-
377-
- if: runner.os == 'macOS'
378-
name: run cpython tests to check if env polluters have stopped polluting (Common/macOS)
379-
shell: bash
380-
run: |
381-
for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_MACOS }}; do
382-
for i in $(seq 1 10); do
383-
set +e
384-
target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing}
385-
exit_code=$?
386-
set -e
387-
if [ ${exit_code} -eq 3 ]; then
388-
echo "Test ${thing} polluted the environment on attempt ${i}."
389-
break
390-
fi
391-
done
392-
if [ ${exit_code} -ne 3 ]; then
393-
echo "Test ${thing} is no longer polluting the environment after ${i} attempts!"
394-
echo "Please remove ${thing} from either ENV_POLLUTING_TESTS_COMMON or ENV_POLLUTING_TESTS_MACOS in '.github/workflows/ci.yaml'."
395-
echo "Please also remove the skip decorators that include the word 'POLLUTERS' in ${thing}."
396-
if [ ${exit_code} -ne 0 ]; then
397-
echo "Test ${thing} failed with exit code ${exit_code}."
398-
echo "Please investigate which test item in ${thing} is failing and either mark it as an expected failure or a skip."
399-
fi
400-
exit 1
401-
fi
402-
done
403-
timeout-minutes: 15
404-
405-
- if: runner.os == 'Windows'
406-
name: run cpython tests to check if env polluters have stopped polluting (Common/windows)
407-
shell: bash
408-
run: |
409-
for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_WINDOWS }}; do
410-
for i in $(seq 1 10); do
411-
set +e
412-
target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing}
413-
exit_code=$?
414-
set -e
415-
if [ ${exit_code} -eq 3 ]; then
416-
echo "Test ${thing} polluted the environment on attempt ${i}."
417-
break
418-
fi
419-
done
420-
if [ ${exit_code} -ne 3 ]; then
421-
echo "Test ${thing} is no longer polluting the environment after ${i} attempts!"
422-
echo "Please remove ${thing} from either ENV_POLLUTING_TESTS_COMMON or ENV_POLLUTING_TESTS_WINDOWS in '.github/workflows/ci.yaml'."
359+
echo "Please remove ${thing} from either ENV_POLLUTING_TESTS_COMMON or matrix.platform.env_polluting_tests in '.github/workflows/ci.yaml'."
423360
echo "Please also remove the skip decorators that include the word 'POLLUTERS' in ${thing}."
424361
if [ ${exit_code} -ne 0 ]; then
425362
echo "Test ${thing} failed with exit code ${exit_code}."
@@ -436,19 +373,23 @@ jobs:
436373
mkdir site-packages
437374
target/release/rustpython --install-pip ensurepip --user
438375
target/release/rustpython -m pip install six
376+
439377
- name: Check that ensurepip succeeds.
440378
run: |
441379
target/release/rustpython -m ensurepip
442380
target/release/rustpython -c "import pip"
381+
443382
- if: runner.os != 'Windows'
444383
name: Check if pip inside venv is functional
445384
run: |
446385
target/release/rustpython -m venv testvenv
447386
testvenv/bin/rustpython -m pip install wheel
387+
448388
- if: runner.os != 'macOS'
449389
name: Check whats_left is not broken
450390
shell: bash
451391
run: python -I scripts/whats_left.py --no-default-features --features "$(sed -e 's/--[^ ]*//g' <<< "${{ env.CARGO_ARGS }}" | tr -d '[:space:]'),threading,jit"
392+
452393
- if: runner.os == 'macOS' # TODO fix jit on macOS
453394
name: Check whats_left is not broken (macOS)
454395
shell: bash

0 commit comments

Comments
 (0)