-
Notifications
You must be signed in to change notification settings - Fork 255
127 lines (121 loc) · 3.75 KB
/
check.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
on:
push:
branches: [main]
pull_request:
branches: [main]
name: CI
jobs:
fmt:
name: Formatter check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy check
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
features:
["", "manage_clipboard", "open_url", "manage_clipboard,open_url"]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cache-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cache-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
cache-${{ runner.os }}-cargo
- name: Install dependencies
if: runner.os == 'Linux'
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- run: cargo clippy --no-default-features --all-targets --features=${{ matrix.features }} -- -D warnings
clippy_wasm32:
name: Clippy check (wasm32)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
features:
[
"immutable_ctx",
"manage_clipboard",
"open_url",
"manage_clipboard,open_url",
]
env:
RUSTFLAGS: --cfg=web_sys_unstable_apis
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
targets: wasm32-unknown-unknown
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cache-wasm32-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cache-wasm32-cargo-${{ hashFiles('**/Cargo.toml') }}
cache-wasm32-cargo
- run: cargo clippy --no-default-features --target=wasm32-unknown-unknown --all-targets --features=${{ matrix.features }} -- -D warnings
doc:
name: Check documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cache-doc-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cache-doc-cargo-${{ hashFiles('**/Cargo.toml') }}
cache-doc-cargo
- run: cargo doc --all --features "bevy/x11"
env:
RUSTDOCFLAGS: -D warnings
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cache-test-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cache-test-cargo-${{ hashFiles('**/Cargo.toml') }}
cache-test-cargo
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- run: cargo test --all