generated from Azkellas/rust_wgpu_hot_reload
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (121 loc) · 3.81 KB
/
ci.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
128
129
130
name: CI # Continuous Integration
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: Run [${{ matrix.action }} | ${{ matrix.config.name }}]
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
action:
- build
- test
config:
- { name: Linux (x86), os: ubuntu-latest, target: "x86_64-unknown-linux-gnu" }
- { name: Linux (ARM), os: ubuntu-latest, target: "aarch64-unknown-linux-gnu" }
- { name: MacOS (x86), os: macos-latest, target: "x86_64-apple-darwin" }
- { name: MacOS (ARM), os: macos-latest, target: "aarch64-apple-darwin" }
- { name: Windows (x86), os: windows-latest, target: "x86_64-pc-windows-msvc" }
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
targets: ${{ matrix.config.target }}
- name: Setup aarch64
if: matrix.config.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt update
sudo apt install gcc-aarch64-linux-gnu
echo "[target.aarch64-unknown-linux-gnu]" >> ~/.cargo/config
echo "linker = \"aarch64-linux-gnu-gcc\"" >> ~/.cargo/config
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- name: Build
if: matrix.action == 'build'
run: cargo build --all-features --workspace
- name: Test
if: matrix.action == 'test'
run: cargo test --all-features --workspace
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy check
run: cargo clippy --all-features --workspace
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --document-private-items --all-features --workspace
hack:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install nightly
uses: dtolnay/rust-toolchain@nightly
- name: cargo install cargo-hack
uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
- name: Check for all features
run: cargo hack --feature-powerset check
wasm:
name: Wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install nightly
uses: dtolnay/rust-toolchain@nightly
with:
target: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- name: Check for target wasm webgpu
env:
RUSTFLAGS: --cfg=web_sys_unstable_apis
run: cargo check --target wasm32-unknown-unknown
- name: Check for target wasm webgl
run: cargo check --target wasm32-unknown-unknown --features webgl