1919 # Skip running the source code checks when only documentation has been updated
2020 - " !**.md"
2121 - " !**.rst"
22- - " !**.txt" # Any requirements file changes will also involve changing other files
22+ - " !**.txt" # Any requirements file changes will also involve changing other files
2323 push :
2424 branches :
2525 - main
3737 tests :
3838 runs-on : ${{ matrix.os }}
3939 strategy :
40- fail-fast : false # Always report results for all targets
40+ fail-fast : false # Always report results for all targets
4141 max-parallel : 8
4242 matrix :
4343 python-version : ["3.10", "3.11", "3.12", "3.13"]
@@ -51,61 +51,59 @@ jobs:
5151 # for latest versions if the standard actions start emitting warnings
5252
5353 steps :
54- - uses : actions/checkout@v4
55- with :
56- persist-credentials : false
57-
58- - name : Set up Python ${{ matrix.python-version }}
59- uses : actions/setup-python@v5
60- with :
61- python-version : ${{ matrix.python-version }}
62-
63- - name : Get pip cache dir
64- id : pip-cache
65- run : |
66- echo "dir=$(python -m pip cache dir)" >> $GITHUB_OUTPUT
67-
68- - name : Cache bootstrapping dependencies
69- uses : actions/cache@v4
70- with :
71- path : ${{ steps.pip-cache.outputs.dir }}
72- key :
73- pip-${{ matrix.os }}-${{ matrix.python-version }}-v1-${{ hashFiles('pdm.lock') }}
74- restore-keys : |
75- pip-${{ matrix.os }}-${{ matrix.python-version }}-v1-
76-
77- - name : Install PDM
78- run : |
79- # Ensure `pdm` uses the same version as specified in `pdm.lock`
80- # while avoiding the error raised by https://github.com/pypa/pip/issues/12889
81- python -m pip install --upgrade -r ci-bootstrap-requirements.txt
82-
83- - name : Create development virtual environment
84- run : |
85- python -m pdm sync --no-self --dev
86- # Handle Windows vs non-Windows differences in .venv layout
87- VIRTUAL_ENV_BIN_DIR="$PWD/.venv/bin"
88- test -e "$VIRTUAL_ENV_BIN_DIR" || VIRTUAL_ENV_BIN_DIR="$PWD/.venv/Scripts"
89- echo "VIRTUAL_ENV_BIN_DIR=$VIRTUAL_ENV_BIN_DIR" >> "$GITHUB_ENV"
90-
91- - name : Static checks
92- run : |
93- source "$VIRTUAL_ENV_BIN_DIR/activate"
94- python -m tox -v -m static
95-
96- - name : CI-compatible tests
97- run : |
98- source "$VIRTUAL_ENV_BIN_DIR/activate"
99- python -m tox -v -- -m 'not lmstudio'
100-
101- - name : Upload coverage data
102- uses : actions/upload-artifact@v4
103- with :
104- name : coverage-data-${{ matrix.os }}-py${{ matrix.python-version }}
105- path : .coverage.*
106- include-hidden-files : true
107- if-no-files-found : ignore
54+ - uses : actions/checkout@v4
55+ with :
56+ persist-credentials : false
57+
58+ - name : Set up Python ${{ matrix.python-version }}
59+ uses : actions/setup-python@v5
60+ with :
61+ python-version : ${{ matrix.python-version }}
10862
63+ - name : Get pip cache dir
64+ id : pip-cache
65+ run : |
66+ echo "dir=$(python -m pip cache dir)" >> $GITHUB_OUTPUT
67+
68+ - name : Cache bootstrapping dependencies
69+ uses : actions/cache@v4
70+ with :
71+ path : ${{ steps.pip-cache.outputs.dir }}
72+ key : pip-${{ matrix.os }}-${{ matrix.python-version }}-v1-${{ hashFiles('pdm.lock') }}
73+ restore-keys : |
74+ pip-${{ matrix.os }}-${{ matrix.python-version }}-v1-
75+
76+ - name : Install PDM
77+ run : |
78+ # Ensure `pdm` uses the same version as specified in `pdm.lock`
79+ # while avoiding the error raised by https://github.com/pypa/pip/issues/12889
80+ python -m pip install --upgrade -r ci-bootstrap-requirements.txt
81+
82+ - name : Create development virtual environment
83+ run : |
84+ python -m pdm sync --no-self --dev
85+ # Handle Windows vs non-Windows differences in .venv layout
86+ VIRTUAL_ENV_BIN_DIR="$PWD/.venv/bin"
87+ test -e "$VIRTUAL_ENV_BIN_DIR" || VIRTUAL_ENV_BIN_DIR="$PWD/.venv/Scripts"
88+ echo "VIRTUAL_ENV_BIN_DIR=$VIRTUAL_ENV_BIN_DIR" >> "$GITHUB_ENV"
89+
90+ - name : Static checks
91+ run : |
92+ source "$VIRTUAL_ENV_BIN_DIR/activate"
93+ python -m tox -v -m static
94+
95+ - name : CI-compatible tests
96+ run : |
97+ source "$VIRTUAL_ENV_BIN_DIR/activate"
98+ python -m tox -v -- -m 'not lmstudio'
99+
100+ - name : Upload coverage data
101+ uses : actions/upload-artifact@v4
102+ with :
103+ name : coverage-data-${{ matrix.os }}-py${{ matrix.python-version }}
104+ path : .coverage.*
105+ include-hidden-files : true
106+ if-no-files-found : ignore
109107
110108 # Coverage check based on https://hynek.me/articles/ditch-codecov-python/
111109 coverage :
0 commit comments