|
1 | 1 | # Run performance benchmarks |
2 | 2 | # |
3 | | -# Continuous benchmarking using pytest-codspeed. Measures the execution speed |
4 | | -# of tests marked with @pytest.mark.benchmark decorator. |
| 3 | +# Continuous benchmarking with CodSpeed. Measures the execution speed of Rust benchmarks |
| 4 | +# via cargo-codspeed, and Python tests marked with @pytest.mark.benchmark decorator. |
5 | 5 |
|
6 | 6 | name: Benchmarks |
7 | 7 |
|
|
16 | 16 | # performance analysis in order to generate initial data. |
17 | 17 | workflow_dispatch: |
18 | 18 |
|
| 19 | +env: |
| 20 | + CARGO_TERM_COLOR: always |
| 21 | + |
19 | 22 | permissions: {} |
20 | 23 |
|
21 | 24 | jobs: |
22 | | - benchmarks: |
| 25 | + rust-benchmarks: |
| 26 | + name: "Run Rust benchmarks" |
| 27 | + runs-on: ubuntu-24.04 |
| 28 | + steps: |
| 29 | + - name: Checkout repository |
| 30 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 31 | + with: |
| 32 | + persist-credentials: false |
| 33 | + |
| 34 | + - name: Download sample GeoTIFF |
| 35 | + run: | |
| 36 | + curl --create-dir --remote-name --output-dir benches https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/37/M/BV/2024/10/S2A_37MBV_20241029_0_L2A/TCI.tif |
| 37 | + ls -lh benches/ |
| 38 | +
|
| 39 | + - name: Setup rust toolchain, cache and cargo-codspeed binary |
| 40 | + uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2 |
| 41 | + with: |
| 42 | + channel: 1.85.0 # msrv |
| 43 | + cache: false |
| 44 | + cache-target: release |
| 45 | + bins: cargo-codspeed |
| 46 | + |
| 47 | + - name: Build the benchmark target(s) |
| 48 | + run: cargo codspeed build |
| 49 | + |
| 50 | + - name: Run the benchmarks |
| 51 | + uses: CodSpeedHQ/action@6a8e2b874c338bf81cc5e8be715ada75908d3871 # v4.3.4 |
| 52 | + with: |
| 53 | + mode: instrumentation |
| 54 | + run: cargo codspeed run |
| 55 | + |
| 56 | + python-benchmarks: |
| 57 | + name: "Run Python benchmarks" |
23 | 58 | runs-on: ubuntu-24.04 |
24 | 59 | defaults: |
25 | 60 | run: |
|
28 | 63 | steps: |
29 | 64 | # Checkout current git repository |
30 | 65 | - name: Checkout |
31 | | - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 66 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
32 | 67 | with: |
33 | 68 | persist-credentials: false |
34 | 69 |
|
|
55 | 90 |
|
56 | 91 | # Run the benchmark tests |
57 | 92 | - name: Run benchmarks |
58 | | - uses: CodSpeedHQ/action@0010eb0ca6e89b80c88e8edaaa07cfe5f3e6664d # v3.5.0 |
| 93 | + uses: CodSpeedHQ/action@6a8e2b874c338bf81cc5e8be715ada75908d3871 # v4.3.4 |
59 | 94 | with: |
60 | | - run: | |
61 | | - python -m pytest --verbose --codspeed |
| 95 | + mode: instrumentation |
| 96 | + run: python -m pytest --verbose --codspeed |
0 commit comments