@@ -22,25 +22,27 @@ jobs:
2222 matrix :
2323 include :
2424 - 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
2727 - 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
3033 - os : ubuntu-latest
3134 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' || '' }}
3341 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
4244 with :
43- python -version-file : .github/python-version.txt
45+ rust -version: ${{ matrix.rust }}
4446
4547 - name : Run "cargo check"
4648 # the action-rs/cargo action adds inline annotations for "cargo check" output
@@ -49,13 +51,19 @@ jobs:
4951 toolchain : ${{ matrix.rust }}
5052 command : check
5153 args : --workspace --verbose ${{ matrix.args }}
52- - name : Run "cargo test"
54+ - if : matrix.rust != 'nightly' # XXX: weird errors here
55+ name : Run "cargo test"
5356 # the action-rs/cargo action adds inline annotations for "cargo test" output
5457 uses : actions-rs/cargo@9e120dd99b0fbad1c065f686657e914e76bd7b72
5558 with :
5659 toolchain : ${{ matrix.rust }}
5760 command : test
5861 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
5967
6068 build :
6169 strategy :
@@ -69,33 +77,25 @@ jobs:
6977 - name : linux-arm64
7078 os : ubuntu-latest
7179 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
7381 - name : macos-universal
7482 os : macos-latest
7583 target : aarch64-apple-darwin x86_64-apple-darwin
7684 args : --target universal2-apple-darwin
7785 runs-on : ${{ matrix.os }}
7886 name : build mitmproxy-rs (${{ matrix.name }})
7987 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
9090 with :
91- python-version-file : .github/python-version.txt
91+ extra-targets : ${{ matrix.target }}
9292
9393 - if : runner.os == 'Linux'
9494 name : Install maturin[zig] from PyPI
95- uses : install-pinned/maturin-with-zig@4804d730717f28b7565e71e68e5c9fe8c4f9b089
95+ uses : install-pinned/maturin-with-zig@68c027568b7d08df7bc3c52476ae28d1d2d787f5
9696 - if : runner.os != 'Linux'
9797 name : Install maturin from PyPI
98- uses : install-pinned/maturin@c8c3a8f7f2b2ecf1728c96824734c6c6afe7e3e8
98+ uses : install-pinned/maturin@b1e3f698dbd19f284d4363cb361f75b2fa04679c
9999
100100 - if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
101101 run : python .github/scripts/pin-versions.py
@@ -106,7 +106,7 @@ jobs:
106106 # ensure that sdist is building.
107107 # We do this here instead of a separate job because we don't want to wait for the entire matrix.
108108 - if : contains(matrix.args, 'sdist')
109- run : pip install target/wheels/*.tar.gz
109+ run : pip install --no-dependencies target/wheels/*.tar.gz
110110
111111 - uses : actions/upload-artifact@v4
112112 with :
@@ -116,7 +116,7 @@ jobs:
116116 build-macos-app :
117117 runs-on : macos-latest
118118 steps :
119- - uses : actions/ checkout@v4
119+ - uses : mhils/workflows/ checkout@v12
120120 - uses : actions/cache@v4
121121 id : cache-app
122122 with :
@@ -137,62 +137,96 @@ jobs:
137137 name : macos-app
138138 path : mitmproxy-macos/redirector/dist/
139139
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
151143 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
169155
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
170166
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
174172 with :
175173 name : macos-app
176174 path : mitmproxy-macos/redirector/dist/
177175
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
180178 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+
185204 - uses : actions/upload-artifact@v4
186205 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
188218 path : target/wheels
219+ - run : pip install --no-dependencies target/wheels/*.tar.gz
189220
190221 check :
191222 if : always()
192223 needs :
193224 - test
225+ - test-linux-wheel-sdist
194226 - build
195- - build-os-wheels
227+ - build-windows-wheel
228+ - build-linux-wheel
229+ - build-macos-wheel
196230 uses : mhils/workflows/.github/workflows/alls-green.yml@main
197231 with :
198232 jobs : ${{ toJSON(needs) }}
0 commit comments