-
Notifications
You must be signed in to change notification settings - Fork 39
54 lines (47 loc) · 1.43 KB
/
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
49
50
51
52
53
54
name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
rustfmt-clippy:
runs-on: ubuntu-20.04
steps:
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- uses: actions/checkout@v2
- name: Run `cargo fmt`
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run `cargo clippy`
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --features=networking -- -D warnings -A clippy::needless_late_init
build:
needs: rustfmt-clippy
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Build and run tests (linux/macOS)
if: matrix.os != 'windows-latest'
run: |
env RUSTFLAGS="-C opt-level=0" cargo test --verbose --features=networking
- name: Build and run tests (windows)
if: matrix.os == 'windows-latest'
shell: cmd
run: |
call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
env RUSTFLAGS="-C opt-level=0" cargo test --verbose --features=networking