-
Notifications
You must be signed in to change notification settings - Fork 71
48 lines (40 loc) · 1.18 KB
/
benchmark.yml
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
name: Benchmarking
on: [pull_request, push]
env:
# Run all cargo commands with --verbose.
CARGO_TERM_VERBOSE: true
RUST_BACKTRACE: 1
# Deny all compiler warnings.
RUSTFLAGS: "-D warnings"
jobs:
bench:
name: Benchmarking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install Rust and required components
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
# Generate Cargo.lock, needed for the cache.
- name: Generate Cargo.lock
run: cargo generate-lockfile
# Cache.
- name: Cargo cache registry, index and build
uses: actions/[email protected]
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-cache-${{ hashFiles('**/Cargo.lock') }}
# build
- name: Cargo build
# skip this step if we've got a cache hit
if: steps.${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}.outputs.cache-hit != 'true'
run: cargo build --release
# bench
- name: Cargo bench
run: cargo bench