Skip to content

Commit

Permalink
Cache python venv, clean artifacts, fix analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
etpeterson committed Dec 12, 2023
1 parent dc532d5 commit ff081cc
Showing 1 changed file with 37 additions and 9 deletions.
46 changes: 37 additions & 9 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,26 @@ jobs:
algorithms: ${{ steps.algorithms.outputs.algorithms }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
id: setup_python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'pip'
- name: Cache virtualenv
uses: actions/cache@v3
with:
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('requirements.txt') }}
path: .venv
- name: Install dependencies
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install pytest
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
- name: Read algorithms
id: algorithms
run: |
Expand Down Expand Up @@ -42,21 +62,28 @@ jobs:
with:
python-version: "3.11"
cache: 'pip'
- name: Cache virtualenv
uses: actions/cache@v3
with:
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('requirements.txt') }}
path: .venv
- name: Install dependencies
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m pip install -r requirements.txt
python -m pip install pytest
- name: Generate fitting data
run: |
pip install pytest
python -m pytest -m slow --selectAlgorithm ${{ matrix.algorithm }} --saveFileName test_output.csv --SNR ${{ matrix.SNR }} --fitCount 300 --saveDurationFileName test_duration.csv
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
- name: Upload raw data
uses: actions/upload-artifact@v3
with:
name: raw_data_${{ matrix.algorithm }}_${{ matrix.SNR }}
name: WorkingData
path: |
test_output.csv
test_duration.csv
test_output_${{ matrix.algorithm }}_${{ matrix.SNR }}.csv
test_duration_${{ matrix.algorithm }}_${{ matrix.SNR }}.csv
merge:
runs-on: ubuntu-latest
Expand All @@ -68,14 +95,14 @@ jobs:
path: artifacts
- name: Merge fitting results
run: |
cat artifacts/raw_data_*/test_output.csv > test_output.csv
cat artifacts/WorkingData/test_output_*.csv > test_output.csv
- name: Merge timing results
run: |
cat artifacts/raw_data_*/test_duration.csv > test_duration.csv
cat artifacts/WorkingData/test_duration_*.csv > test_duration.csv
- name: Upload merged artifacts
uses: actions/upload-artifact@v3
with:
name: Raw Data
name: Combined Data
path: |
test_output.csv
test_duration.csv
Expand All @@ -84,6 +111,7 @@ jobs:
runs-on: ubuntu-latest
needs: merge
steps:
- uses: actions/checkout@v3
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
Expand Down

0 comments on commit ff081cc

Please sign in to comment.