-
Notifications
You must be signed in to change notification settings - Fork 85
83 lines (79 loc) · 2.37 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
name: CI
on:
pull_request:
push:
branches:
- master
env:
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0 # makes cache smaller
CARGO_PROFILE_DEV_DEBUG: 0
jobs:
clippy:
name: Clipy and format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Check format
run: cargo fmt -- --check
- name: Cache cargo registry
uses: actions/cache@v4
with:
key: index-${{ hashFiles('Cargo.lock') }}
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
- name: Cache cargo crates
uses: actions/cache@v4
with:
key: crates-${{ hashFiles('Cargo.lock') }}
path: ~/.cargo/registry/cache
- name: Cache target directory
uses: actions/cache@v4
with:
path: target
key: clippy-${{ hashFiles('Cargo.lock') }}
- name: Fetch dependencies
run: cargo fetch
- name: Run clippy
run: cargo clippy --all --all-targets --target-dir=target
- name: Run clippy on integration tests
run: cargo clippy --all --all-targets --features=integration_test --target-dir=target
- name: Run clippy on C API
run: cargo clippy --all-targets --manifest-path=c-api/Cargo.toml --target-dir=target
- name: Run clippy on JS API
run: cargo clippy --all-targets --manifest-path=js-api/Cargo.toml --target-dir=target
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry
uses: actions/cache@v4
with:
key: index-${{ hashFiles('Cargo.lock') }}
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
- name: Cache cargo crates
uses: actions/cache@v4
with:
key: crates-${{ hashFiles('Cargo.lock') }}
- name: Fetch dependencies
run: cargo fetch
- name: Cache target directory
uses: actions/cache@v4
with:
path: target
key: target-${{ hashFiles('Cargo.lock') }}
- name: Run Rust tests
run: scripts/test.sh