@@ -19,10 +19,14 @@ concurrency:
1919 cancel-in-progress : ${{ startsWith(github.ref, 'refs/pull/') }}
2020
2121# Set the correct env variables for all the unit tests
22+ permissions :
23+ contents : read
24+
2225env :
2326 TORAX_ERRORS_ENABLED : 1
2427 TORAX_JAXTYPING : 1
25- PYTEST_NUM_SHARDS : 8 # Controls tests sharding enabled by `pytest-shard`
28+ PYTEST_NUM_SHARDS : 12 # Controls tests sharding enabled by `pytest-shard`
29+ JAX_ENABLE_X64 : 1
2630
2731jobs :
2832 shards-job :
@@ -57,10 +61,12 @@ jobs:
5761 os-version : [ubuntu-latest]
5862
5963 steps :
60- - uses : actions/checkout@v6
64+ - uses : actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # refs/tags/v6.1.0
65+ with :
66+ persist-credentials : false
6167
6268 # Install deps
63- - uses : actions/setup-python@v6
69+ - uses : actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # refs/tags/v6.3.0
6470 with :
6571 python-version : ${{ matrix.python-version }}
6672
@@ -71,13 +77,17 @@ jobs:
7177
7278 # Run tests (in parallel)
7379 - name : Run core tests
80+ env :
81+ SHARD_ID : ${{ matrix.shard-id }}
82+ NUM_SHARDS : ${{ matrix.num-shards }}
7483 run : |
84+ SHARD_ZERO=$((SHARD_ID - 1))
7585 pytest \
7686 -vv -n auto \
7787 --ignore=torax/tests/sim_no_compile_test.py \
78- --shard-id=$((${{ matrix.shard-id }} - 1)) -- num-shards=${{ env.PYTEST_NUM_SHARDS }}
88+ --shard-id=$SHARD_ZERO -- num-shards=$NUM_SHARDS
7989 # This test requires an extra environment variable, so we run it separately.
8090 - name : Run sim_no_compile
81- if : ${{ matrix. shard-id == 2 }}
91+ if : matrix[' shard-id'] == 2
8292 run : |
8393 JAX_DISABLE_JIT=True pytest -vv -n auto torax/tests/sim_no_compile_test.py
0 commit comments