-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (46 loc) · 1.33 KB
/
ci.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
49
50
name: CI
on: push
jobs:
formatting:
name: Formatting
runs-on: ubuntu-latest
strategy:
matrix:
dir: [., ./client, ./common]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --check --manifest-path ${{ matrix.dir }}/Cargo.toml
linting:
name: Build and linting
runs-on: ubuntu-latest
strategy:
matrix:
dir: [., ./client, ./common]
target: [x86_64-unknown-linux-gnu, wasm32-unknown-unknown]
exclude:
- dir: .
target: wasm32-unknown-unknown
- dir: ./client
target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: clippy
- run: cargo clippy --manifest-path ${{ matrix.dir }}/Cargo.toml --target ${{ matrix.target }} -- -Dwarnings
test:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
# all tests are run on host target
dir: [., ./client, ./common]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: sudo apt-get install libpcap-dev
- run: cargo test --manifest-path ${{ matrix.dir }}/Cargo.toml