-
Notifications
You must be signed in to change notification settings - Fork 1
139 lines (107 loc) · 3.85 KB
/
Copy pathci.yml
File metadata and controls
139 lines (107 loc) · 3.85 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
name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTC_WRAPPER: sccache
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: taiki-e/install-action@cargo-make
- uses: taiki-e/install-action@nextest
- uses: mozilla-actions/sccache-action@v0.0.9
- name: Install iperf3
run: sudo apt-get update && sudo apt-get install -y iperf3
- name: Enable unprivileged user namespaces
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: Build
run: cargo build --workspace --all-targets
- name: Test
run: cargo nextest run --workspace --profile ci
- name: Clippy
run: cargo clippy --workspace --tests -- -D warnings
- name: Format
run: cargo make format-check
macos-check:
runs-on: [self-hosted, macOS, arm64]
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: actions/setup-node@v5
with:
node-version: "20"
- uses: mozilla-actions/sccache-action@v0.0.9
- name: Build patchbay-vm
run: cargo build -p patchbay-vm
- name: Clippy patchbay-vm
run: cargo clippy -p patchbay-vm -- -D warnings
- name: Container backend smoke test
run: |
if ! command -v container >/dev/null 2>&1; then
echo "container CLI not found, skipping smoke test"
exit 0
fi
if ! command -v aarch64-linux-musl-gcc >/dev/null 2>&1; then
echo "musl cross-compiler not found, skipping smoke test"
echo "install with: brew install filosottile/musl-cross/musl-cross"
exit 0
fi
rustup target add aarch64-unknown-linux-musl
cargo build --release -p patchbay-vm -p patchbay-runner --bin patchbay --target aarch64-unknown-linux-musl
./target/release/patchbay-vm --backend container run \
--patchbay-version "path:target/aarch64-unknown-linux-musl/release/patchbay" \
./patchbay-cli/tests/fixtures/iperf-1to1-public.toml
./target/release/patchbay-vm --backend container down
e2e:
runs-on: [self-hosted, linux, x64]
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: actions/setup-node@v5
with:
node-version: "20"
cache: npm
cache-dependency-path: ui/package-lock.json
- name: Install UI dependencies
working-directory: ui
run: npm ci
- name: Build UI bundle
working-directory: ui
run: npm run build
- name: Install Playwright browser and system deps
working-directory: ui
run: npx playwright install --with-deps chromium
- name: Install iperf3
run: sudo apt-get update && sudo apt-get install -y iperf3
- name: Enable unprivileged user namespaces
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true
- name: Build Rust (bins + test targets)
run: cargo build --workspace --all-targets
- name: UI E2E
working-directory: ui
run: npm run test:e2e
cargo_deny:
timeout-minutes: 30
name: cargo deny
runs-on: ubuntu-latest
# cargo-deny-action runs in a Docker container that does not have sccache
# installed, so override the workflow-wide RUSTC_WRAPPER env var.
env:
RUSTC_WRAPPER: ""
steps:
- uses: actions/checkout@v6
- uses: EmbarkStudios/cargo-deny-action@v2
with:
arguments: --workspace --all-features
command: check
command-arguments: "-Dwarnings"