Repository navigation
63 lines (60 loc) · 2.42 KB
/
Copy pathexecute.yml
File metadata and controls
63 lines (60 loc) · 2.42 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
name: Execution Benchmarks on CI
on:
workflow_dispatch:
# Disable running jobs on earlier commits.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
execute:
name: Run Execution Benchmarks (${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
# Keeps the `> out.json` redirect and `cat` identical on all runners.
shell: bash
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
features: "--all-features"
- os: macos-latest
features: "--all-features"
- os: windows-latest
features: "--no-default-features --features windows"
steps:
- name: System Information (Linux)
if: runner.os == 'Linux'
run: lscpu
- name: System Information (macOS)
if: runner.os == 'macOS'
run: sysctl -a machdep.cpu
- name: System Information (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: Get-CimInstance Win32_Processor | Select-Object Name, NumberOfCores, NumberOfLogicalProcessors
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
- name: Install Cargo Criterion (tool)
run: cargo install cargo-criterion || true
- name: Compile Benchmarks
run: cargo criterion --bench criterion ${{ matrix.features }} --no-run
- name: Clear Stale Criterion Data
# Criterion reports results for benchmarks it finds in `target/criterion`, even ones the
# current run did not execute. Should the Rust cache ever restore that directory, results
# from an earlier run (on different hardware, with a different feature set) would leak into
# the JSON below. On a fresh runner this is a no-op.
run: rm -rf target/criterion
- name: Run Benchmarks
# Keep `--message-format` between the features and the `execute/` filter: `--features`
# takes multiple values and would otherwise swallow the filter as a feature name.
run: cargo criterion --bench criterion ${{ matrix.features }} --message-format=json execute/ > out.json
- name: Print JSON Output
run: cat out.json