-
Notifications
You must be signed in to change notification settings - Fork 17
121 lines (114 loc) · 3.05 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
name: CI
on:
push:
branches:
- staging
- trying
pull_request:
branches: [master]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test-windows:
name: Run tests on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- uses: Swatinem/rust-cache@v2
with:
key: windows-latest-test
- name: Test
run: cargo test --features task,subscriber,fixture,task_unstable,io,sync,future,net,tls,rust_tls,timer,fs,zero_copy,mmap,retry
test:
name: Check ${{ matrix.check }} on (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
rust: [stable]
check: [test]
include:
- os: ubuntu-latest
rust: stable
check: fmt
- os: ubuntu-latest
rust: stable
check: clippy
- os: ubuntu-latest
rust: stable
check: audit
steps:
- uses: actions/checkout@v3
- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ matrix.check }}
- name: Clippy
if: ${{ matrix.check == 'clippy' }}
run: make check-clippy
- name: Fmt
if: ${{ matrix.check == 'fmt' }}
run: make check-fmt
- name: Test
if: ${{ matrix.check == 'test' }}
timeout-minutes: 15
run: make test-all
- name: cargo audit
if: ${{ matrix.check == 'audit' }}
timeout-minutes: 15
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
wasm_test:
name: ${{ matrix.test.name }} on (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
# fail-fast: false
matrix:
include:
- os: ubuntu-latest
rust: stable
test: linux-wasm
# - os: macos-latest
# rust: stable
# test: mac-wasm
steps:
- uses: actions/checkout@v3
- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
target: wasm32-unknown-unknown
- name: Run Wasm Test on Linux
if: matrix.test == 'linux-wasm'
run: |
cargo install websocat
websocat -t ws-l:127.0.0.1:1234 mirror: & disown
make test-wasm
- name: Run Wasm Test on Mac
if: matrix.test == 'mac-wasm'
run: |
brew install websocat
websocat -t ws-l:127.0.0.1:1234 mirror: & disown
make test-wasm-safari
done:
name: Done
needs:
- test-windows
- test
- wasm_test
runs-on: ubuntu-latest
steps:
- name: Done
run: echo "Done!"