Skip to content

Commit ce33fad

Browse files
committed
Cache python venv, clean artifacts, fix analysis
1 parent 6677460 commit ce33fad

File tree

1 file changed

+37
-9
lines changed

1 file changed

+37
-9
lines changed

.github/workflows/analysis.yml

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,26 @@ jobs:
1313
algorithms: ${{ steps.algorithms.outputs.algorithms }}
1414
steps:
1515
- uses: actions/checkout@v3
16+
- name: Set up Python
17+
id: setup_python
18+
uses: actions/setup-python@v4
19+
with:
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
27+
- name: Install dependencies
28+
run: |
29+
python -m venv .venv
30+
source .venv/bin/activate
31+
python -m pip install --upgrade pip
32+
python -m pip install -r requirements.txt
33+
python -m pip install pytest
34+
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
35+
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
1636
- name: Read algorithms
1737
id: algorithms
1838
run: |
@@ -42,21 +62,28 @@ jobs:
4262
with:
4363
python-version: "3.11"
4464
cache: 'pip'
65+
- name: Cache virtualenv
66+
uses: actions/cache@v3
67+
with:
68+
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('requirements.txt') }}
69+
path: .venv
4570
- name: Install dependencies
4671
run: |
72+
python -m venv .venv
73+
source .venv/bin/activate
4774
python -m pip install --upgrade pip
48-
pip install -r requirements.txt
75+
python -m pip install -r requirements.txt
76+
python -m pip install pytest
4977
- name: Generate fitting data
5078
run: |
51-
pip install pytest
52-
python -m pytest -m slow --selectAlgorithm ${{ matrix.algorithm }} --saveFileName test_output.csv --SNR ${{ matrix.SNR }} --fitCount 300 --saveDurationFileName test_duration.csv
79+
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
5380
- name: Upload raw data
5481
uses: actions/upload-artifact@v3
5582
with:
56-
name: raw_data_${{ matrix.algorithm }}_${{ matrix.SNR }}
83+
name: WorkingData
5784
path: |
58-
test_output.csv
59-
test_duration.csv
85+
test_output_${{ matrix.algorithm }}_${{ matrix.SNR }}.csv
86+
test_duration_${{ matrix.algorithm }}_${{ matrix.SNR }}.csv
6087
6188
merge:
6289
runs-on: ubuntu-latest
@@ -68,14 +95,14 @@ jobs:
6895
path: artifacts
6996
- name: Merge fitting results
7097
run: |
71-
cat artifacts/raw_data_*/test_output.csv > test_output.csv
98+
cat artifacts/WorkingData/test_output_*.csv > test_output.csv
7299
- name: Merge timing results
73100
run: |
74-
cat artifacts/raw_data_*/test_duration.csv > test_duration.csv
101+
cat artifacts/WorkingData/test_duration_*.csv > test_duration.csv
75102
- name: Upload merged artifacts
76103
uses: actions/upload-artifact@v3
77104
with:
78-
name: Raw Data
105+
name: Combined Data
79106
path: |
80107
test_output.csv
81108
test_duration.csv
@@ -84,6 +111,7 @@ jobs:
84111
runs-on: ubuntu-latest
85112
needs: merge
86113
steps:
114+
- uses: actions/checkout@v3
87115
- name: Set up R
88116
uses: r-lib/actions/setup-r@v2
89117
with:

0 commit comments

Comments
 (0)