-
-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (51 loc) · 1.28 KB
/
test.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
name: "Test"
on:
push:
branches: ["main"]
paths:
- "**.rs"
- "static/**"
- "Cargo.toml"
- "Cargo.lock"
pull_request:
branches: ["main"]
paths:
- "**.rs"
- "static/**"
- "Cargo.toml"
- "Cargo.lock"
types: [ready_for_review, opened, synchronize]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Test:
if: github.event.pull_request.draft == false || github.event_name == 'push'
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable]
steps:
- name: GitHub Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Setup Rust toolchain
uses: hecrj/setup-rust-action@v2
with:
rust-version: ${{ matrix.rust }}
components: rustfmt, clippy
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Ensure code compiles
run: |
cargo build --all
cargo build --all --release
- name: Run Tests
run: cargo test --all
- name: Run Clippy
run: cargo clippy --all -- -D warnings
- name: Run Rustfmt
run: cargo fmt --all --check