Skip to content

Commit 9a9977e

Browse files
committed
ci(workflows): add env variables to ensure GitHub Actions runs are deterministic
1 parent 192e198 commit 9a9977e

3 files changed

Lines changed: 35 additions & 5 deletions

File tree

.github/workflows/daily.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ concurrency:
99
group: daily-${{ github.ref }}
1010
cancel-in-progress: true
1111

12+
env:
13+
OMP_NUM_THREADS: 1
14+
MKL_NUM_THREADS: 1
15+
OPENBLAS_NUM_THREADS: 1
16+
NUMEXPR_NUM_THREADS: 1
17+
PYTHONHASHSEED: 0
18+
1219
jobs:
1320
unit:
1421
name: Unit (${{ matrix.os }}, py${{ matrix.python-version }})
@@ -37,4 +44,4 @@ jobs:
3744
python -m pip install -e .[testing]
3845
3946
- name: Run unit tests
40-
run: python -m pytest tests/unit
47+
run: python -m pytest tests/unit -n auto --dist=loadscope

.github/workflows/pr.yaml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,19 @@ concurrency:
77
group: pr-${{ github.ref }}
88
cancel-in-progress: true
99

10+
env:
11+
OMP_NUM_THREADS: 1
12+
MKL_NUM_THREADS: 1
13+
OPENBLAS_NUM_THREADS: 1
14+
NUMEXPR_NUM_THREADS: 1
15+
PYTHONHASHSEED: 0
16+
1017
jobs:
1118
unit:
1219
name: Unit
1320
runs-on: ${{ matrix.os }}
1421
timeout-minutes: 25
22+
1523
strategy:
1624
fail-fast: false
1725
matrix:
@@ -33,8 +41,10 @@ jobs:
3341
python -m pip install --upgrade pip
3442
python -m pip install -e .[testing]
3543
36-
- name: Pytest (unit) • ${{ matrix.os }}, ${{ matrix.python-version }}
37-
run: python -m pytest tests/unit
44+
- name: Run unit tests
45+
run: |
46+
python -m pytest tests/unit -n auto --dist=loadscope
47+
3848
3949
discover-systems:
4050
name: Discover regression systems
@@ -63,6 +73,7 @@ jobs:
6373
SYSTEMS=$(python -m tests.regression.list_systems)
6474
echo "systems=$SYSTEMS" >> $GITHUB_OUTPUT
6575
76+
6677
regression-quick:
6778
name: Regression (fast) • ${{ matrix.system }}
6879
needs: [unit, discover-systems]
@@ -95,13 +106,13 @@ jobs:
95106
python -m pip install --upgrade pip
96107
python -m pip install -e .[testing]
97108
98-
- name: Run fast regression tests (per system)
109+
- name: Run fast regression tests (parallel)
99110
run: |
100111
python -m pytest tests/regression \
101112
-m "not slow" \
113+
-k "${{ matrix.system }}" \
102114
-n auto \
103115
--dist=loadscope \
104-
-k "${{ matrix.system }}" \
105116
-vv \
106117
--durations=20
107118
@@ -114,6 +125,7 @@ jobs:
114125
.testdata/**
115126
/tmp/pytest-of-*/pytest-*/**
116127
128+
117129
docs:
118130
name: Docs
119131
needs: unit
@@ -147,6 +159,7 @@ jobs:
147159
name: docs-html
148160
path: docs/_build/html
149161

162+
150163
pre-commit:
151164
name: Pre-commit
152165
runs-on: ubuntu-24.04
@@ -176,6 +189,7 @@ jobs:
176189
exit 1
177190
}
178191
192+
179193
coverage:
180194
name: Coverage
181195
needs: unit
@@ -203,6 +217,8 @@ jobs:
203217
--cov CodeEntropy \
204218
--cov-report term-missing \
205219
--cov-report xml \
220+
-n auto \
221+
--dist=loadscope \
206222
-q
207223
208224
- name: Upload coverage to Coveralls

.github/workflows/weekly-regression.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ concurrency:
99
group: weekly-regression-${{ github.ref }}
1010
cancel-in-progress: true
1111

12+
env:
13+
OMP_NUM_THREADS: 1
14+
MKL_NUM_THREADS: 1
15+
OPENBLAS_NUM_THREADS: 1
16+
NUMEXPR_NUM_THREADS: 1
17+
PYTHONHASHSEED: 0
18+
1219
jobs:
1320
discover:
1421
name: Discover regression systems

0 commit comments

Comments
 (0)