Skip to content

Commit f3df2c6

Browse files
committed
Cache python environment.
1 parent 1f4cbf4 commit f3df2c6

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

.github/workflows/analysis.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@ jobs:
1919
with:
2020
python-version: "3.11"
2121
cache: 'pip'
22-
# - name: Cache virtualenv
23-
# uses: actions/cache@v3
24-
# with:
25-
# key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('requirements.txt') }}
26-
# path: .venv
22+
- name: Cache pip
23+
uses: actions/cache@v3
24+
id: pip-cache
25+
with:
26+
key: ${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }}
27+
path: ${{ env.pythonLocation }}
28+
if: steps.python-cache.outputs.cache-hit != 'true'
29+
2730
- name: Install dependencies
2831
run: |
29-
python -m venv .venv
30-
source .venv/bin/activate
31-
python -m pip install -r requirements.txt
32-
python -m pip install pytest
32+
pip install -r requirements.txt
33+
3334
- name: Read algorithms
3435
id: algorithms
3536
run: |
@@ -59,20 +60,16 @@ jobs:
5960
with:
6061
python-version: "3.11"
6162
cache: 'pip'
62-
# - name: Cache virtualenv
63-
# uses: actions/cache@v3
64-
# with:
65-
# key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('requirements.txt') }}
66-
# path: .venv
67-
- name: Install dependencies
68-
run: |
69-
python -m venv .venv
70-
source .venv/bin/activate
71-
python -m pip install -r requirements.txt
72-
python -m pip install pytest
63+
- name: Cache pip
64+
id: python-cache
65+
uses: actions/cache@v3
66+
with:
67+
key: ${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }}
68+
path: ${{ env.pythonLocation }}
69+
if: steps.python-cache.outputs.cache-hit != 'true'
70+
7371
- name: Generate fitting data
7472
run: |
75-
source .venv/bin/activate
7673
python -m pytest -m slow --selectAlgorithm ${{ matrix.algorithm }} --saveFileName test_output_${{ matrix.algorithm }}_${{ matrix.SNR }}.csv --SNR ${{ matrix.SNR }} --fitCount 300 --saveDurationFileName test_duration_${{ matrix.algorithm }}_${{ matrix.SNR }}.csv
7774
- name: Upload raw data
7875
uses: actions/upload-artifact@v3

0 commit comments

Comments
 (0)