forked from PyVRP/PyVRP
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (63 loc) · 2.7 KB
/
Copy pathCodSpeed.yml
File metadata and controls
69 lines (63 loc) · 2.7 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
68
69
name: CodSpeed
on:
push:
branches: [ main ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
bench:
name: Run benchmarks
runs-on: ubuntu-24.04
env:
CODSPEED_TOKEN: ${{ secrets.CODSPEED_TOKEN }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.13'
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "0.11.3"
enable-cache: true
- name: Install Python dependencies
run: uv sync --no-install-project
- name: Update package index
run: |
# Change mirror priorities because Azure can be really slow - https://github.com/actions/runner-images/issues/7048.
sudo sed -i '/archive.ubuntu.com\/ubuntu\/\tpriority/ s/priority:2/priority:0/' /etc/apt/apt-mirrors.txt
sudo sed -i '/azure.archive.ubuntu.com\/ubuntu\/\tpriority/ s/priority:0/priority:1/' /etc/apt/apt-mirrors.txt
sudo sed -i '/security.ubuntu.com\/ubuntu\/\tpriority/ s/priority:3/priority:2/' /etc/apt/apt-mirrors.txt
sudo apt-get update
- name: Set up GCC
run: |
sudo apt-get install -y gcc-14 g++-14
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 10
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-14 10
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
- name: Build pyvrp
# First, we install the project into the environment. This ensures
# imports like "from pyvrp import X" work. This builds in release mode
# by default, but we'd like to have debug symbols for CodSpeed to make
# sense, so we have to build in debugoptimized mode.
run: |
uv sync
uv run buildtools/build_extensions.py --build_type debugoptimized --clean
- name: Run benchmarks with CodSpeed
if: ${{ env.CODSPEED_TOKEN != '' }}
# We evaluate the microbenchmarks using the release build.
uses: CodSpeedHQ/action@76578c2a7ddd928664caa737f0e962e3085d4e7c # v3.8.1
with:
token: ${{ env.CODSPEED_TOKEN }}
run: uv run pytest benchmarks/ --codspeed
- name: Run benchmarks without CodSpeed upload
if: ${{ env.CODSPEED_TOKEN == '' }}
run: uv run pytest benchmarks/