-
Notifications
You must be signed in to change notification settings - Fork 37
67 lines (57 loc) · 1.82 KB
/
codspeed.yml
File metadata and controls
67 lines (57 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: CodSpeed
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
benchmarks:
name: Run benchmarks
runs-on: codspeed-macro
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.15.0-beta.1
architecture: arm64-freethreaded
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: uv sync
- name: Hash the dataset seed
# Mix a hash of the secret seed into the cache key so changing the
# seed invalidates the cache, without exposing the seed itself
# (cache keys are visible in the Actions UI).
id: seed-hash
env:
DATASET_SEED: ${{ secrets.DATASET_SEED }}
run: |
hash=$(printf '%s' "$DATASET_SEED" | shasum -a 256 | head -c 16)
echo "value=$hash" >> "$GITHUB_OUTPUT"
- name: Cache datasets
id: cache-datasets
uses: actions/cache@v4
with:
path: |
rounds/1_histogram/data
rounds/2_corruption/data
rounds/3_dna/data
key: datasets-${{ hashFiles('rounds/*/gen_data.py', 'scripts/setup.py') }}-${{ steps.seed-hash.outputs.value }}
- name: Generate datasets
if: steps.cache-datasets.outputs.cache-hit != 'true'
env:
DATASET_SEED: ${{ secrets.DATASET_SEED }}
run: uv run scripts/setup.py ${DATASET_SEED:+--seed "$DATASET_SEED"}
- name: Run correctness tests
run: uv run pytest -k "not test_bench"
- name: Run benchmarks
uses: CodSpeedHQ/action@v4
with:
mode: walltime
run: uv run pytest --codspeed