-
-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (46 loc) · 1.38 KB
/
rust.yml
File metadata and controls
54 lines (46 loc) · 1.38 KB
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
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
name: Rust CI
jobs:
rust_ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
rust: [stable, beta]
steps:
- name: Prepare git
if: startsWith(matrix.os, 'windows')
run: |-
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v6
with:
submodules: "recursive"
- name: Cache cargo
uses: actions/cache@v4
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-${{ matrix.rust }}-build-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.rust }}-build-target-
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
targets: wasm32-unknown-unknown
components: rustfmt, clippy
- run: cargo fmt --all -- --check
- run: cargo clippy --all -- -D warnings
- run: cargo clippy --target wasm32-unknown-unknown -- -D warnings
- run: cargo test --all