-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (157 loc) · 4.72 KB
/
ci.yml
File metadata and controls
166 lines (157 loc) · 4.72 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: clippy (${{ matrix.features }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- features: default
flags: ""
- features: minimal
flags: "--no-default-features"
- features: tui-only
flags: "--no-default-features --features tui"
- features: pprof-only
flags: "--no-default-features --features pprof"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: Swatinem/rust-cache@v2
with:
key: clippy-${{ matrix.features }}
- run: cargo clippy --all-targets ${{ matrix.flags }} -- -D warnings
deny:
name: cargo-deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check bans licenses sources advisories
test:
name: test (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
runner: ubuntu-latest
- target: aarch64-unknown-linux-gnu
runner: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: cargo test (default features)
run: cargo test --target ${{ matrix.target }}
- name: cargo test (--no-default-features)
run: cargo test --target ${{ matrix.target }} --no-default-features
- name: cargo build --release
run: cargo build --release --target ${{ matrix.target }}
smoke:
name: smoke (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
needs: test
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
runner: ubuntu-latest
- target: aarch64-unknown-linux-gnu
runner: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}-smoke
- name: install PHP
run: ./scripts/ci/install-php.sh
- name: build
run: cargo build --release --target ${{ matrix.target }}
- name: smoke
run: ./scripts/ci/smoke.sh ./target/${{ matrix.target }}/release/pfp
smoke-zts:
name: smoke-zts (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
needs: test
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
runner: ubuntu-latest
php_image: php:8.3-zts
- target: aarch64-unknown-linux-gnu
runner: ubuntu-24.04-arm
php_image: php:8.3-zts
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}-smoke-zts
- name: build
run: cargo build --release --target ${{ matrix.target }}
- name: smoke (ZTS)
run: ./scripts/ci/smoke-zts.sh ./target/${{ matrix.target }}/release/pfp ${{ matrix.php_image }}
smoke-pyroscope:
name: smoke-pyroscope
runs-on: ubuntu-latest
needs: test
services:
pyroscope:
image: grafana/pyroscope:latest
ports:
- 4040:4040
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: Swatinem/rust-cache@v2
with:
key: x86_64-unknown-linux-gnu-smoke-pyroscope
- name: install PHP
run: ./scripts/ci/install-php.sh
- name: build
run: cargo build --release
- name: smoke (pyroscope)
run: ./scripts/ci/smoke-pyroscope.sh ./target/release/pfp