@@ -18,18 +18,18 @@ jobs:
18
18
uses : actions/setup-python@v5
19
19
with :
20
20
python-version : " 3.11"
21
- 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
21
+ - name : Cache pip
22
+ uses : actions/cache@v3
23
+ id : pip-cache
24
+ with :
25
+ key : ${{ runner.os }}-${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }}
26
+ path : ${{ env.pythonLocation }}
27
+ if : steps.pip-cache.outputs.cache-hit != 'true'
28
+
27
29
- name : Install dependencies
28
30
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
31
+ pip install -r requirements.txt
32
+
33
33
- name : Read algorithms
34
34
id : algorithms
35
35
run : |
@@ -58,21 +58,16 @@ jobs:
58
58
uses : actions/setup-python@v5
59
59
with :
60
60
python-version : " 3.11"
61
- 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
61
+ if : steps.pip-cache.outputs.cache-hit != 'true'
62
+ - name : Restore cache
63
+ id : python-cache
64
+ uses : actions/cache@v3
65
+ with :
66
+ key : ${{ runner.os }}-${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }}
67
+ path : ${{ env.pythonLocation }}
68
+
73
69
- name : Generate fitting data
74
70
run : |
75
- source .venv/bin/activate
76
71
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
77
72
- name : Upload raw data
78
73
uses : actions/upload-artifact@v3
0 commit comments