-
Notifications
You must be signed in to change notification settings - Fork 3
145 lines (125 loc) · 3.78 KB
/
check.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Check
on:
pull_request:
branches: [ "main" ]
jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --tests -- --deny "warnings"
rust-fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all --check
cargo-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: |
cargo test
cargo test --doc
cargo test --package tsp --features nacl
cargo test --package tsp --lib --features pq
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check
arguments: --workspace
check-wasm32:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Run tests with wasm-pack
working-directory: tsp
run: wasm-pack test --node -- -p tsp --no-default-features --features "resolve"
check-python:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install maturin
run: pip install maturin
- name: Create and activate virtual environment
working-directory: tsp-python
run: |
python -m venv venv
source venv/bin/activate
pip install maturin
- name: Build and test
working-directory: tsp-python
run: |
source venv/bin/activate
maturin develop
python3 test.py
check-node:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
wasm-pack --version
- name: Build Wasm extension
run: wasm-pack build --target nodejs tsp-javascript/
- name: Install npm dependencies
working-directory: tsp-node/
run: npm install
- name: Run tests with Mocha
working-directory: tsp-node/
run: npm test
fuzz:
name: run cargo-fuzz
runs-on: ubuntu-latest
strategy:
matrix:
features:
- ""
steps:
- uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248
with:
toolchain: nightly
- uses: Swatinem/rust-cache@v2
- name: Install cargo fuzz
uses: taiki-e/install-action@8984d603c208823d3c1a1b796f4081736f3ae3f9
with:
tool: cargo-fuzz
- name: Smoke-test fuzz targets
run: |
cargo fuzz build ${{ matrix.features }}
for target in $(cargo fuzz list ${{ matrix.features }}) ; do
cargo fuzz run ${{ matrix.features }} $target -- -max_total_time=10
done