-
-
Notifications
You must be signed in to change notification settings - Fork 4
183 lines (150 loc) Β· 4.91 KB
/
Copy pathci.yml
File metadata and controls
183 lines (150 loc) Β· 4.91 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
fmt:
name: Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Engine dependency direction
run: python tools/check_architecture.py
- name: Cargo fmt
run: cargo fmt --all -- --check
machete:
name: Unused Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cargo-machete
uses: taiki-e/install-action@v2
with:
tool: cargo-machete
- name: Cargo machete
run: cargo machete
test:
name: Test (${{ matrix.os }})
needs: fmt
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libdbus-1-dev libudev-dev libwayland-dev libxkbcommon-dev pkg-config
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Restore Cargo cache
# Toolchain + lockfile + target host remain part of rust-cache's key.
# Share dependency artifacts with later Clippy and ignored-test jobs.
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-workspace
- name: Cargo test
if: runner.os != 'Windows'
env:
PERRO_AUDIO_DISABLED: "1"
run: cargo test --workspace
- name: Cargo test (Windows, non-graphics)
if: runner.os == 'Windows'
env:
PERRO_AUDIO_DISABLED: "1"
run: cargo test --workspace --exclude perro_graphics
- name: Cargo test (Windows graphics, serial GPU access)
if: runner.os == 'Windows'
env:
PERRO_AUDIO_DISABLED: "1"
run: cargo test -p perro_graphics -- --test-threads=1
editor:
name: Perro Editor Project
needs: fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Linux system dependencies
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libdbus-1-dev libudev-dev libwayland-dev libxkbcommon-dev pkg-config
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Restore Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-workspace
- name: Check editor scripts
env:
PERRO_AUDIO_DISABLED: "1"
run: cargo run -p perro_cli -- check --path perro_editor
- name: Clippy editor scripts and run project doctor
env:
PERRO_AUDIO_DISABLED: "1"
run: cargo run -p perro_cli -- clippy --path perro_editor
- name: Test editor scripts
env:
PERRO_AUDIO_DISABLED: "1"
run: cargo run -p perro_cli -- test --path perro_editor
slow-test:
name: Slow Tests (nested cargo check)
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Linux system dependencies
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libdbus-1-dev libudev-dev libwayland-dev libxkbcommon-dev pkg-config
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Restore Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-workspace
- name: Cargo test (ignored)
env:
PERRO_AUDIO_DISABLED: "1"
run: cargo test -p perro_compiler -- --ignored
clippy:
name: Clippy (${{ matrix.os }})
needs: test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libdbus-1-dev libudev-dev libwayland-dev libxkbcommon-dev pkg-config
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
targets: wasm32-unknown-unknown
- name: Restore Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-workspace
- name: Cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings