-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (124 loc) · 3.59 KB
/
ci.yaml
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Build
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
rust: [stable]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.71.0
with:
toolchain: ${{matrix.rust}}
components: rust-src, rustfmt
- name: Install build system dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -y install --no-install-recommends \
curl \
ca-certificates \
clang \
make \
pkg-config \
libelf-dev \
zlib1g-dev
- name: Build
run: |
export RUSTFLAGS='-L /usr/lib/x86_64-linux-gnu'
cargo build
- name: Static build
run: |
export RUSTFLAGS='-L /usr/lib/x86_64-linux-gnu -C target-feature=+crt-static'
cargo build --target x86_64-unknown-linux-gnu
lint:
name: Lint
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
rust: [stable]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.71.0
with:
toolchain: ${{matrix.rust}}
components: rust-src, rustfmt
- name: Run cargo fmt
run: |
# These files are generated at build time, so some rustfmt versions
# fail with Error writing files: failed to resolve mod `bpf` if it
# does not exist
touch src/bpf/py-perf.rs
touch src/bpf/features.rs
cargo fmt
git diff --exit-code
clippy:
name: Clippy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.71.0
with:
components: rust-src, clippy, rustfmt
- name: Install build system dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -y install --no-install-recommends \
curl \
ca-certificates \
clang \
make \
pkg-config \
libelf-dev \
zlib1g-dev
- name: Run clippy
run: |
export RUSTFLAGS='-L /usr/lib/x86_64-linux-gnu'
cargo clippy -- -Dclippy::all
test:
name: Test
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
rust: [stable]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.71.0
with:
toolchain: ${{matrix.rust}}
components: rust-src, rustfmt
- name: Install build system dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -y install --no-install-recommends \
curl \
ca-certificates \
clang \
make \
pkg-config \
libelf-dev \
zlib1g-dev
- name: Run unittests
run: |
export RUSTFLAGS='-L /usr/lib/x86_64-linux-gnu'
export RUST_BACKTRACE=1
cargo test -- --skip py-perf::tests
- name: Install podman
run: sudo apt-get -y install --no-install-recommends podman
- name: Pull Ruby containers
run: tools/pull_ruby_images
- name: Run integration tests
run: |
export RUSTFLAGS='-L /usr/lib/x86_64-linux-gnu'
export RUST_BACKTRACE=1
# Running only 3.1.2 for a bit, will enable the rest once we make sure
# that things are looking good
cargo test -- py-perf::tests::py-perf_test_3_1_2 --nocapture