-
Notifications
You must be signed in to change notification settings - Fork 2
129 lines (112 loc) · 3.28 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
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
name: CI
on:
push:
branches:
- trying
- staging
jobs:
test:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
default: true
profile: minimal
components: rustfmt, clippy
- uses: actions/setup-node@v2
if: matrix.os == 'windows-latest'
with:
node-version: '16'
- uses: Swatinem/rust-cache@v1
- name: Clippy
run: cargo clippy --all --all-targets -- -D clippy::all
- name: Test (ubuntu/macos)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
env:
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: sudo -E
CARGO_TARGET_X86_64_APPLE_DARWIN_RUNNER: sudo -E
RUSTFLAGS: -D warnings
run: cargo test --all --all-targets --all-features --locked
- name: Cache node_modules (windows)
if: matrix.os == 'windows-latest'
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-
- name: Test (windows)
if: matrix.os == 'windows-latest'
shell: bash
env:
RUSTFLAGS: -D warnings
TESTING: 1
run: |
set -ex
cd windows-gui-client && yarn && yarn build && cd ..
cargo test --all --all-targets --locked
- name: Fmt check
if: matrix.os == 'macos-latest'
run: |
set -ex
cargo fmt --all -- --check
cd tools/check-copyright && cargo fmt -- --check && cargo build --release && cd ../..
./tools/check-copyright/target/release/check-copyright
cd fuzz && cargo fmt -- --check
# Make CI a bit faster running these in parallel with other tests.
integration-test-and-check-fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
profile: minimal
- name: Integration Test
run: |
set -ex
sudo apt-get update
sudo apt-get install -yqq wireguard net-tools
cargo build
cd ns-test
sudo ./integration-test.sh
sudo ./interop-test.sh
- name: Check Fuzz
run: cd fuzz && cargo check --locked
cross-test:
strategy:
matrix:
target:
- x86_64-unknown-freebsd
- aarch64-unknown-linux-gnu
- mipsel-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
default: true
profile: minimal
components: clippy
- uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.target }}
- name: Clippy
uses: actions-rs/cargo@v1
with:
use-cross: true
command: clippy
args: --locked --all --all-features --all-targets --target ${{ matrix.target }} -- -D clippy::all
- name: Test
if: matrix.target != 'x86_64-unknown-freebsd'
uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --target ${{ matrix.target }}