-
Notifications
You must be signed in to change notification settings - Fork 43
43 lines (34 loc) · 1.02 KB
/
check.yaml
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
name: Check
on:
push:
branches:
- main
pull_request:
types: ['opened', 'reopened', 'synchronize', 'ready_for_review']
concurrency:
# Allow only one workflow per any non-`main` branch.
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
jobs:
tests:
name: Run Clippy and tests
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- run: rustup default nightly-2024-04-30 && rustup component add rustfmt clippy
- name: Cache dependencies
uses: swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: cargo fmt check
run: cargo fmt --check
- name: cargo clippy
run: cargo clippy
- name: cargo test
run: cargo test