generated from eerii/hello-bevy
-
Notifications
You must be signed in to change notification settings - Fork 3
77 lines (62 loc) · 2 KB
/
test.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
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
name: test
# Based on https://github.com/bevyengine/bevy_github_ci_template/blob/main/.github/workflows/ci.yaml
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Cargo test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Remove debug config
run: rm -f .cargo/config.toml
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }}
- name: Install rust
uses: dtolnay/rust-toolchain@nightly
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev protobuf-compiler libprotobuf-dev
- name: Cargo test
run: cargo test
clippy_check:
name: Cargo clippy and fmt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Remove debug config
run: rm -f .cargo/config.toml
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.toml') }}
- name: Install rust
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev protobuf-compiler libprotobuf-dev
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Run fmt
run: cargo fmt --all -- --check