-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.18 KB
/
rust.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
name: Main
# inspired by bevy: https://raw.githubusercontent.com/bevyengine/bevy_github_ci_template/main/.github/workflows/ci.yaml
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
# Run cargo test
quality:
runs-on: ubuntu-latest
# container: fabienjuif/ubuntu-asound-dev
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Run cargo test
run: cargo test