-
Notifications
You must be signed in to change notification settings - Fork 20
130 lines (115 loc) · 4.56 KB
/
ci.yml
File metadata and controls
130 lines (115 loc) · 4.56 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- uses: moonrepo/setup-rust@abb2d32350334249b178c401e5ec5836e0cd88d3 # v1
with:
components: rustfmt, clippy
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
with:
extra_args: --all-files
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
lfs: true
submodules: true
- name: "Install rust-toolchain.toml"
run: rustup toolchain install
# We use Swatinem/rust-cache to cache cargo registry, index and target in this job
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
# Install memtrack for the memory integration tests
- name: Install dependencies required for libbpf-sys (vendored feature)
run: sudo apt-get update && sudo apt-get install -y autopoint bison flex
- name: Install memtrack
run: |
cargo install --path crates/memtrack --locked
- name: Install exec-harness
run: |
cargo install --path crates/exec-harness --locked
- run: cargo test --all --exclude memtrack --exclude exec-harness
exec-harness-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- uses: moonrepo/setup-rust@abb2d32350334249b178c401e5ec5836e0cd88d3 # v1
- name: Run tests
run: cargo test -p exec-harness
basic-run-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- name: "Install rust-toolchain.toml"
run: rustup toolchain install
# We use Swatinem/rust-cache to cache cargo registry, index and target in this job
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- name: Run tests
run: cargo run -- exec -m simulation,walltime,memory --skip-upload -- ls -la
bpf-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
lfs: true
submodules: true
- uses: moonrepo/setup-rust@abb2d32350334249b178c401e5ec5836e0cd88d3 # v1
- name: Install dependencies required for libbpf-sys (vendored feature)
run: sudo apt-get update && sudo apt-get install -y autopoint bison flex
- name: Install additional allocators
run: sudo apt-get install -y libmimalloc-dev libjemalloc-dev
- name: Run tests
env:
RUST_LOG: debug
run: sudo -E $(which cargo) test -- --test-threads 1 --nocapture
working-directory: crates/memtrack
# Since we ran the tests with sudo, the build artifacts will have root ownership
- name: Clean up
run: sudo chown -R $USER:$USER . ~/.cargo
windows-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- name: "Install rust-toolchain.toml"
run: rustup toolchain install
- name: Add Windows GNU target
run: rustup target add x86_64-pc-windows-gnu
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- name: Check codspeed-runner builds on Windows
# Instrument hooks fails to build with msvc target, so we use the gnu target for this check for now
run: cargo check -p codspeed-runner --target x86_64-pc-windows-gnu
benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- name: "Install rust-toolchain.toml"
run: rustup toolchain install
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
- name: Install cargo codspeed
uses: taiki-e/install-action@0c7a94999971db56e9df89df226240aab222e776 # v2
with:
tool: cargo-codspeed
- name: Build benchmarks
run: cargo codspeed build -p runner-shared
- name: Run benchmarks
uses: CodSpeedHQ/action@db35df748deb45fdef0960669f57d627c1956c30 # v4
with:
mode: simulation
run: cargo codspeed run -p runner-shared