File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
Expand file tree Collapse file tree 1 file changed +31
-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@v4
68+ with :
69+ path : .pytest_cache
70+ key : ${{ runner.os }}-pytest-cache-${{ matrix.os }}-${{ matrix.python }}-${{ github.ref_name }}
71+
6472 - name : Create nox venv
6573 env :
6674 NOX_SESSION : ${{ matrix.nox-session }}
@@ -74,12 +82,34 @@ jobs:
7482 pip freeze
7583 deactivate
7684
85+ # Restore pytest cache only for pytest_min session
86+ - name : Restore pytest cache
87+ if : ${{ matrix.nox-session == 'pytest_min' }}
88+ uses : actions/cache@v4
89+ with :
90+ path : .pytest_cache
91+ key : ${{ runner.os }}-pytest-cache-${{ matrix.os }}-${{ matrix.python }}-${{ github.ref_name }}
92+
93+ # Run nox session
7794 - name : Run nox
7895 env :
7996 NOX_SESSION : ${{ matrix.nox-session }}
80- run : nox -R -e "$NOX_SESSION"
97+ run : |
98+ if [ "$NOX_SESSION" = "pytest_min" ]; then
99+ nox -R -e "$NOX_SESSION" -- --ff --cache-dir=".pytest_cache"
100+ else
101+ nox -R -e "$NOX_SESSION"
102+ fi
81103 timeout-minutes : 10
82104
105+ # Save pytest cache only for pytest_min session
106+ - name : Save pytest cache
107+ if : ${{ matrix.nox-session == 'pytest_min' }}
108+ uses : actions/cache@v4
109+ with :
110+ path : .pytest_cache
111+ key : ${{ runner.os }}-pytest-cache-${{ matrix.os }}-${{ matrix.python }}-${{ github.ref_name }}
112+
83113 # This job runs if all the `nox` matrix jobs ran and succeeded.
84114 # It is only used to have a single job that we can require in branch
85115 # 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