-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (61 loc) · 2.21 KB
/
Copy pathbenchmark.yml
File metadata and controls
73 lines (61 loc) · 2.21 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
70
71
72
73
name: benchmark
# CI guardrail for benchmark/ -- the one directory of runnable
# source in this otherwise source-free, closed-source repository. Runs on
# macOS because the harness is macOS-only by design: it depends on
# lsappinfo, footprint, vm_stat, notifyutil, and pmset, all Darwin-only
# tools.
#
# This workflow builds, lints, and tests the harness only. It deliberately
# never runs `resource-benchmark run` (or `doctor` against real installed
# subjects): a real sweep needs an exclusive, quiesced physical machine for
# hours, and its numbers would be meaningless -- and misleading -- if
# produced on a shared, noisy CI runner. Do not add that here.
on:
push:
paths:
- 'benchmark/**'
- '.github/workflows/benchmark.yml'
pull_request:
paths:
- 'benchmark/**'
- '.github/workflows/benchmark.yml'
concurrency:
group: benchmark-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
working-directory: benchmark
jobs:
check:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
# benchmark/rustfmt.toml sets nightly-only options (e.g.
# unstable_features), so the format check needs a nightly rustfmt --
# stable `cargo fmt` reads a different subset of the config and
# produces different output.
# Installing nightly second makes it rustup's default, so every step
# below names its toolchain explicitly rather than relying on that
# ordering -- `cargo clippy` under nightly fails outright, since the
# nightly toolchain installed here carries rustfmt and nothing else.
- name: Install Rust nightly (rustfmt only)
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: benchmark -> target
- name: Format check (nightly rustfmt)
run: cargo +nightly fmt -- --check
- name: Clippy
run: cargo +stable clippy --all-targets -- -D warnings
- name: Test
run: cargo +stable test