-
Notifications
You must be signed in to change notification settings - Fork 21
48 lines (42 loc) · 1.22 KB
/
build-and-test.yml
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
---
name: Build and test
on:
push:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: --deny warnings
jobs:
# Enable this after fixing all the stuff clippy complains about
# linting:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# components: clippy
# default: true
# - name: Lint (clippy)
# uses: actions-rs/clippy-check@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
build-and-test:
strategy:
matrix:
rust: [stable, beta, nightly, 1.56.0]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #v1.0.7
with:
toolchain: ${{ matrix.rust }}
profile: minimal
default: true
- name: Build
run: cargo build --all-targets
- name: Test
# Since the tests modify global state (the system firewall) they cannot run in parallel.
# The integration tests must run as root since they write firewall state (/dev/pf)
run: sudo cargo test -- --test-threads=1