Skip to content

Commit 8b14e49

Browse files
committed
Fixed pytest in pre-commit CI workflow for WSL
1 parent 525510f commit 8b14e49

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/pre-commit_wsl.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,31 @@ jobs:
132132
source .env/bin/activate
133133
134134
pre-commit run -a
135+
- name: CPU database cache
136+
id: cache-cpu-databases
137+
uses: actions/cache@v5
138+
with:
139+
path: |
140+
the_repo/cpumark_table.csv
141+
the_repo/cpu-spec-dataset
142+
key: cpu_databases
143+
- name: CPU database population
144+
if: steps.cache-cpu-databases.outputs.cache-hit != 'true'
145+
run: |
146+
source ~/.bash_profile
147+
cd the_repo
148+
source .env/bin/activate
149+
150+
python -m treecript.tdp_sources cpumark_table.tsv
151+
git clone https://github.com/JosuaCarl/cpu-spec-dataset
135152
- name: 'pytest + coverage (${{ matrix.python-version }})'
136153
shell: wsl-bash {0}
137154
run: |
138155
source ~/.bash_profile
139156
cd the_repo
140157
source .env/bin/activate
141158
142-
pytest --cov=treecript
159+
CACHED_CPU_SPEC_DATASET=${PWD}/cpu-spec-dataset CACHED_CPUMARK_DATASET=${PWD}/cpumark_table.tsv pytest --cov=treecript
143160
- uses: actions/upload-artifact@v6
144161
with:
145162
name: wsl_pre-commit-${{ matrix.python-version }}_${{ matrix.distribution }}

0 commit comments

Comments
 (0)