-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (86 loc) · 2.35 KB
/
ci.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
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Cargo
# This workflow run tests and build for each push
on:
pull_request:
push:
branches:
- main
- 'feature-**'
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- nightly-2023-10-25
steps:
- uses: actions/checkout@v4
- uses: streetsidesoftware/cspell-action@v5
- uses: cargo-bins/cargo-binstall@main
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: "clippy, rustfmt"
- name: Info
run: |
cargo binstall --git https://github.com/estk/cargo-sort
rustc --version
cargo --version --verbose
cargo clippy --version
cargo fmt --version
- name: Lint
run: |
cargo fmt -- --check
cargo clippy -- -D warnings
cargo sort --check
cargo:
name: Build & Test
runs-on: ubuntu-latest
strategy:
matrix:
features_arg:
- --features serde
toolchain:
- stable
- beta
- nightly
- nightly-2023-10-25
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- uses: taiki-e/install-action@nextest
- name: Info
run: |
cargo --version --verbose
rustc --version
- name: Test
run: |
cargo check
cargo nextest run --all ${{ matrix.features_arg }}
- name: Build
run: |
cargo build --release ${{ matrix.features_arg }}
benchmark:
name: Run benchmarks
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: trace4rs
BENCHER_TESTBED: ubuntu-latest
BENCHER_ADAPTER: rust
BENCHER_VERSION: 0.2.27
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install
run: |
rustup update
rustup toolchain install nightly
wget https://github.com/bencherdev/bencher/releases/download/v${BENCHER_VERSION}/bencher_${BENCHER_VERSION}_amd64.deb
sudo dpkg -i bencher_${BENCHER_VERSION}_amd64.deb
- name: Benchmark with Bencher
run: bencher run --if-branch $GITHUB_REF_NAME --err "cargo bench"