-
Notifications
You must be signed in to change notification settings - Fork 32
61 lines (58 loc) · 1.62 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
name: CI
on:
push:
branches:
- master
- staging
- trying
pull_request:
jobs:
check_formatting:
runs-on: ubuntu-latest
name: Check Rust formatting
steps:
- uses: actions/checkout@v3
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy_correctness_checks:
runs-on: ubuntu-latest
name: Clippy correctness checks
strategy:
fail-fast: false
matrix:
config:
- { target: 'x86_64-unknown-linux-gnu', target_dir: 'target' }
- { target: 'wasm32-unknown-unknown', target_dir: 'web-target' }
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y -q \
libasound2-dev \
libudev-dev
- uses: actions/checkout@v3
- name: Install WASM Target
if: matrix.config.target == 'wasm32-unknown-unknown'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.config.target }}
components: clippy
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
web-target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/cargo@v1
env:
CARGO_TARGET_DIR: ${{ matrix.config.target_dir }}
with:
command: clippy
args: --target ${{ matrix.config.target }} -- -W clippy::correctness -D warnings