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
name: build
on:
push:
branches:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2
- name: Lint
run: .dev/rs-lint
- name: Test
run: make rs-test
- name: Reference check
# the unoptimised run in `make rs-test` takes a slice of the sweep; a
# release build is ninety times faster and takes the lot
run: make rs-oracle
- name: Property sweep
# `make rs-test` runs the properties at proptest's default 256 cases,
# unoptimised; release makes a sweep hundreds of times wider affordable
# on every PR, which is where a rare input actually turns up
run: make rs-fuzz
- name: Benchmarks
# --test runs each benchmark once instead of measuring it: enough to
# catch a bench that stopped compiling, fast enough for every PR
run: |
cargo bench --bench arithmetic -- --test
cargo bench --bench orderbook -- --test
- name: Docs
# warnings are errors here, so a broken intra-doc link fails the build
# rather than shipping a dead link to docs.rs
env:
RUSTDOCFLAGS: -Dwarnings
run: make docs