File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 6161 python -m pip install -e .[dev-noxfile]
6262 pip freeze
6363
64+ # Restore pytest cache only for pytest_min session to use the cache
65+ - name : Restore pytest cache
66+ if : ${{ matrix.nox-session == 'pytest_min' }}
67+ uses : actions/cache/restore@v4
68+ id : restore-pytest-cache
69+ with :
70+ path : .pytest_cache
71+ key : ${{ runner.os }}-pytest-cache-${{ matrix.os }}-${{ matrix.python }}-${{ github.ref_name }}-v4
72+
6473 - name : Create nox venv
6574 env :
6675 NOX_SESSION : ${{ matrix.nox-session }}
@@ -74,12 +83,26 @@ jobs:
7483 pip freeze
7584 deactivate
7685
86+ # Run nox session
7787 - name : Run nox
7888 env :
7989 NOX_SESSION : ${{ matrix.nox-session }}
80- run : nox -R -e "$NOX_SESSION"
90+ run : |
91+ if [ "$NOX_SESSION" = "pytest_min" ]; then
92+ nox -R -e "$NOX_SESSION" -- --ff -o cache_dir=.pytest_cache
93+ else
94+ nox -R -e "$NOX_SESSION"
95+ fi
8196 timeout-minutes : 10
8297
98+ # Save pytest cache only for pytest_min session
99+ - name : Save pytest cache
100+ if : always() && matrix.nox-session == 'pytest_min' && steps.restore-pytest-cache.outputs.cache-hit != 'true'
101+ uses : actions/cache/save@v4
102+ with :
103+ path : .pytest_cache
104+ key : ${{ runner.os }}-pytest-cache-${{ matrix.os }}-${{ matrix.python }}-${{ github.ref_name }}-v4
105+
83106 # This job runs if all the `nox` matrix jobs ran and succeeded.
84107 # It is only used to have a single job that we can require in branch
85108 # protection rules, so we don't have to update the protection rules each time
You can’t perform that action at this time.
0 commit comments