11name : Benchmark
22on :
3+ push :
4+ branches :
5+ - main
36 pull_request :
47 paths :
58 - ' .github/workflows/benchmark.yml'
69 - ' src/**'
710 - ' tests/**'
811 workflow_dispatch :
9- inputs :
10- base_commit :
11- description : The base commit to compare against
12-
1312
1413permissions :
1514 contents : read
1615
17- concurrency :
18- group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
19- cancel-in-progress : true
20-
2116env :
2217 CARGO_REGISTRIES_CRATES_IO_PROTOCOL : sparse
2318
@@ -28,38 +23,23 @@ jobs:
2823 steps :
2924 - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3025 timeout-minutes : 3
31- with :
32- persist-credentials : false
33- path : " cryptography-pr"
34- - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
35- timeout-minutes : 3
36- with :
37- repository : " pyca/cryptography"
38- path : " cryptography-base"
39- ref : " ${{ github.event.inputs.base_commit || github.base_ref }}"
4026 - name : Clone test vectors
4127 timeout-minutes : 2
42- uses : ./cryptography-base/ .github/actions/fetch-vectors
28+ uses : ./.github/actions/fetch-vectors
4329
4430 - name : Setup python
4531 id : setup-python
4632 uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
4733 with :
48- python-version : " 3.11 "
34+ python-version : " 3.12 "
4935
50- - name : Create virtualenv (base)
51- run : |
52- python -m venv .venv-base
53- .venv-base/bin/pip install -v -c ./cryptography-base/ci-constraints-requirements.txt "./cryptography-base[test]" ./cryptography-base/vectors/
54- - name : Create virtualenv (PR)
36+ - name : Create virtualenv
5537 run : |
56- python -m venv .venv-pr
57- .venv-pr /bin/pip install -v -c ./cryptography-pr/ ci-constraints-requirements.txt "./cryptography-pr [test]" ./cryptography-pr /vectors/
38+ python -m venv .venv
39+ .venv/bin/pip install -v -c ./ci-constraints-requirements.txt "./[test]" ./vectors/
5840
59- - name : Run benchmarks (base)
60- run : .venv-base/bin/pytest --benchmark-enable --benchmark-only ./cryptography-pr/tests/bench/ --benchmark-json=bench-base.json --x509-limbo-root=x509-limbo/
61- - name : Run benchmarks (PR)
62- run : .venv-pr/bin/pytest --benchmark-enable --benchmark-only ./cryptography-pr/tests/bench/ --benchmark-json=bench-pr.json --x509-limbo-root=x509-limbo/
63-
64- - name : Compare results
65- run : python ./cryptography-pr/.github/compare_benchmarks.py bench-base.json bench-pr.json | tee -a $GITHUB_STEP_SUMMARY
41+ - name : Run benchmarks
42+ uses : CodSpeedHQ/action@v2
43+ with :
44+ token : ${{ secrets.CODSPEED_TOKEN }}
45+ run : .venv/bin/pytest --codspeed --benchmark-enable --benchmark-only ./tests/bench/ --benchmark-json=bench-pr.json --x509-limbo-root=x509-limbo/
0 commit comments