@@ -22,25 +22,27 @@ jobs:
22
22
matrix :
23
23
include :
24
24
- os : windows-latest
25
- rust : " 1.80" # MSRV
26
- args : --exclude macos-certificate-truster
25
+ rust : " 1.80" # MSRV - can't use variables here.
26
+ args : --exclude mitmproxy-linux-ebpf
27
27
- os : macos-latest
28
- rust : " 1.80"
29
- args : --exclude windows-redirector
28
+ rust : " 1.80" # MSRV - can't use variables here.
29
+ args : --exclude mitmproxy-linux-ebpf
30
+ - os : ubuntu-22.04
31
+ rust : " 1.80" # MSRV - can't use variables here.
32
+ args : --exclude mitmproxy-linux-ebpf
30
33
- os : ubuntu-latest
31
34
rust : stable
32
- args : --exclude windows-redirector --exclude macos-certificate-truster
35
+ args : --exclude mitmproxy-linux-ebpf
36
+ - os : ubuntu-latest # old Ubuntu to test eBPF verifier compatibility
37
+ rust : nightly
38
+ args : --package mitmproxy-linux-ebpf
39
+ env :
40
+ RUSTFLAGS : ${{ matrix.rust == 'nightly' && '-Zpanic_abort_tests -C panic=abort' || '' }}
33
41
steps :
34
- - uses : actions/checkout@v4
35
- - name : Set up Rust toolchain
36
- run : rustup toolchain install ${{ matrix.rust }} --profile minimal
37
- - uses : Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
38
- timeout-minutes : 2
39
- continue-on-error : true
40
- # PyO3 wants recent Python on Windows.
41
- - uses : actions/setup-python@v5
42
+ - uses : mhils/workflows/checkout@v12
43
+ - uses : ./.github/actions/setup
42
44
with :
43
- python -version-file : .github/python-version.txt
45
+ rust -version: ${{ matrix.rust }}
44
46
45
47
- name : Run "cargo check"
46
48
# the action-rs/cargo action adds inline annotations for "cargo check" output
@@ -49,13 +51,19 @@ jobs:
49
51
toolchain : ${{ matrix.rust }}
50
52
command : check
51
53
args : --workspace --verbose ${{ matrix.args }}
52
- - name : Run "cargo test"
54
+ - if : matrix.rust != 'nightly' # XXX: weird errors here
55
+ name : Run "cargo test"
53
56
# the action-rs/cargo action adds inline annotations for "cargo test" output
54
57
uses : actions-rs/cargo@9e120dd99b0fbad1c065f686657e914e76bd7b72
55
58
with :
56
59
toolchain : ${{ matrix.rust }}
57
60
command : test
58
61
args : --workspace --verbose ${{ matrix.args }}
62
+ - if : matrix.os == 'ubuntu-22.04' # Test that eBPF loads
63
+ run : cargo test --features root-tests
64
+ working-directory : mitmproxy-linux
65
+ env :
66
+ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER : sudo -E
59
67
60
68
build :
61
69
strategy :
@@ -69,33 +77,25 @@ jobs:
69
77
- name : linux-arm64
70
78
os : ubuntu-latest
71
79
target : aarch64-unknown-linux-gnu
72
- args : --compatibility manylinux2014 --zig --target aarch64-unknown-linux-gnu
80
+ args : --compatibility manylinux2014 --zig --target aarch64-unknown-linux-gnu -i 3.12
73
81
- name : macos-universal
74
82
os : macos-latest
75
83
target : aarch64-apple-darwin x86_64-apple-darwin
76
84
args : --target universal2-apple-darwin
77
85
runs-on : ${{ matrix.os }}
78
86
name : build mitmproxy-rs (${{ matrix.name }})
79
87
steps :
80
- - uses : actions/checkout@v4
81
- - run : rustup toolchain install stable --profile minimal
82
- - run : rustup default stable
83
- - if : matrix.target
84
- run : rustup target add ${{ matrix.target }}
85
- - run : rustup show
86
- - uses : Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
87
- timeout-minutes : 2
88
- continue-on-error : true
89
- - uses : actions/setup-python@v5
88
+ - uses : mhils/workflows/checkout@v12
89
+ - uses : ./.github/actions/setup
90
90
with :
91
- python-version-file : .github/python-version.txt
91
+ extra-targets : ${{ matrix.target }}
92
92
93
93
- if : runner.os == 'Linux'
94
94
name : Install maturin[zig] from PyPI
95
- uses : install-pinned/maturin-with-zig@4804d730717f28b7565e71e68e5c9fe8c4f9b089
95
+ uses : install-pinned/maturin-with-zig@68c027568b7d08df7bc3c52476ae28d1d2d787f5
96
96
- if : runner.os != 'Linux'
97
97
name : Install maturin from PyPI
98
- uses : install-pinned/maturin@c8c3a8f7f2b2ecf1728c96824734c6c6afe7e3e8
98
+ uses : install-pinned/maturin@b1e3f698dbd19f284d4363cb361f75b2fa04679c
99
99
100
100
- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
101
101
run : python .github/scripts/pin-versions.py
@@ -106,7 +106,7 @@ jobs:
106
106
# ensure that sdist is building.
107
107
# We do this here instead of a separate job because we don't want to wait for the entire matrix.
108
108
- if : contains(matrix.args, 'sdist')
109
- run : pip install target/wheels/*.tar.gz
109
+ run : pip install --no-dependencies target/wheels/*.tar.gz
110
110
111
111
- uses : actions/upload-artifact@v4
112
112
with :
@@ -116,7 +116,7 @@ jobs:
116
116
build-macos-app :
117
117
runs-on : macos-latest
118
118
steps :
119
- - uses : actions/ checkout@v4
119
+ - uses : mhils/workflows/ checkout@v12
120
120
- uses : actions/cache@v4
121
121
id : cache-app
122
122
with :
@@ -137,62 +137,96 @@ jobs:
137
137
name : macos-app
138
138
path : mitmproxy-macos/redirector/dist/
139
139
140
- build-os-wheels :
141
- needs : build-macos-app
142
- strategy :
143
- matrix :
144
- include :
145
- - os : windows
146
- build-rust : --package windows-redirector
147
- - os : macos
148
- build-rust : --package macos-certificate-truster
149
- runs-on : ${{ matrix.os }}-latest
150
- name : build mitmproxy-${{ matrix.os }}
140
+ build-windows-wheel :
141
+ runs-on : windows-latest
142
+ name : build mitmproxy-windows
151
143
steps :
152
- - uses : actions/checkout@v4
153
-
154
- # Build Rust
155
- - uses : Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
156
- timeout-minutes : 2
157
- continue-on-error : true
158
- - run : rustup toolchain install stable --profile minimal
159
- - run : rustup default stable
160
- - if : runner.os == 'macOS'
161
- run : rustup target add aarch64-apple-darwin x86_64-apple-darwin
162
- - if : runner.os == 'macOS'
163
- run : |
164
- cargo build --release ${{ matrix.build-rust }} --target x86_64-apple-darwin
165
- cargo build --release ${{ matrix.build-rust }} --target aarch64-apple-darwin
166
- lipo -create -output target/release/macos-certificate-truster target/x86_64-apple-darwin/release/macos-certificate-truster target/aarch64-apple-darwin/release/macos-certificate-truster
167
- - if : runner.os != 'macOS'
168
- run : cargo build --release ${{ matrix.build-rust }}
144
+ - uses : mhils/workflows/checkout@v12
145
+ - uses : ./.github/actions/setup
146
+ - uses : install-pinned/build@aa7fb973fec4a5593736c5dc25b322120ca41a98
147
+
148
+ - run : cargo build --release --package windows-redirector
149
+
150
+ - run : python -m build --wheel ./mitmproxy-windows --outdir target/wheels/
151
+ - uses : actions/upload-artifact@v4
152
+ with :
153
+ name : wheels-os-windows
154
+ path : target/wheels
169
155
156
+ build-macos-wheel :
157
+ name : build mitmproxy-macos
158
+ needs : build-macos-app
159
+ runs-on : macos-latest
160
+ steps :
161
+ - uses : mhils/workflows/checkout@v12
162
+ - uses : ./.github/actions/setup
163
+ with :
164
+ extra-targets : aarch64-apple-darwin x86_64-apple-darwin
165
+ - uses : install-pinned/build@aa7fb973fec4a5593736c5dc25b322120ca41a98
170
166
171
- # Download macOS app
172
- - if : runner.os == 'macOS'
173
- uses : actions/download-artifact@v4
167
+ - run : |
168
+ cargo build --release --package macos-certificate-truster --target x86_64-apple-darwin
169
+ cargo build --release --package macos-certificate-truster --target aarch64-apple-darwin
170
+ lipo -create -output target/release/macos-certificate-truster target/x86_64-apple-darwin/release/macos-certificate-truster target/aarch64-apple-darwin/release/macos-certificate-truster
171
+ - uses : actions/download-artifact@v4
174
172
with :
175
173
name : macos-app
176
174
path : mitmproxy-macos/redirector/dist/
177
175
178
- # Build & upload wheel
179
- - uses : actions/setup-python@v5
176
+ - run : python -m build -- wheel ./mitmproxy-macos --outdir target/wheels/
177
+ - uses : actions/upload-artifact@v4
180
178
with :
181
- python-version-file : .github/python-version.txt
182
- - name : Install build from PyPI
183
- uses : install-pinned/build@67059894d5ef2398af490c98fa8af8542d7b7008
184
- - run : python -m build --wheel ./mitmproxy-${{ matrix.os }} --outdir target/wheels/
179
+ name : wheels-os-macos
180
+ path : target/wheels
181
+
182
+ build-linux-wheel :
183
+ name : build mitmproxy-${{ matrix.name }}
184
+ strategy :
185
+ matrix :
186
+ include :
187
+ - name : linux-x86_64
188
+ args : --compatibility manylinux2014 --zig --sdist
189
+ - name : linux-arm64
190
+ target : aarch64-unknown-linux-gnu
191
+ args : --compatibility manylinux2014 --zig --target aarch64-unknown-linux-gnu -i 3.12
192
+ runs-on : ubuntu-latest
193
+ steps :
194
+ - uses : mhils/workflows/checkout@v12
195
+ - uses : ./.github/actions/setup
196
+ with :
197
+ extra-targets : ${{ matrix.target }}
198
+ - name : Install maturin[zig] from PyPI
199
+ uses : install-pinned/maturin-with-zig@68c027568b7d08df7bc3c52476ae28d1d2d787f5
200
+
201
+ - run : maturin build --release ${{ matrix.args }}
202
+ working-directory : ./mitmproxy-linux
203
+
185
204
- uses : actions/upload-artifact@v4
186
205
with :
187
- name : wheels-os-${{ runner.os }}
206
+ name : wheels-os-${{ matrix.name }}
207
+ path : target/wheels
208
+
209
+ test-linux-wheel-sdist :
210
+ needs : build-linux-wheel
211
+ runs-on : ubuntu-latest
212
+ steps :
213
+ - uses : mhils/workflows/checkout@v12
214
+ - uses : ./.github/actions/setup
215
+ - uses : actions/download-artifact@v4
216
+ with :
217
+ name : wheels-os-linux-x86_64
188
218
path : target/wheels
219
+ - run : pip install --no-dependencies target/wheels/*.tar.gz
189
220
190
221
check :
191
222
if : always()
192
223
needs :
193
224
- test
225
+ - test-linux-wheel-sdist
194
226
- build
195
- - build-os-wheels
227
+ - build-windows-wheel
228
+ - build-linux-wheel
229
+ - build-macos-wheel
196
230
uses : mhils/workflows/.github/workflows/alls-green.yml@main
197
231
with :
198
232
jobs : ${{ toJSON(needs) }}
0 commit comments