-
Notifications
You must be signed in to change notification settings - Fork 31
99 lines (83 loc) · 2.89 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
name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
build:
strategy:
fail-fast: false
matrix:
toolchain: [stable, beta]
os: [windows-2022, ubuntu-22.04, macos-12]
exclude:
- os: macos-12
toolchain: beta
- os: windows-2022
toolchain: beta
runs-on: ${{ matrix.os }}
needs: clean
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- name: Install XCB and GL dependencies
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install libx11-xcb-dev libgl1-mesa-dev
- name: Build
run: cargo check --features "rafx-vulkan" --manifest-path demo/Cargo.toml
env:
RUSTFLAGS: "-C debuginfo=0 -D warnings"
- name: Build
run: cargo check --no-default-features --features "rafx-vulkan,basic-pipeline,use-egui" --manifest-path demo/Cargo.toml
env:
RUSTFLAGS: "-C debuginfo=0 -D warnings"
- name: Run tests (vulkan)
if: ${{ runner.os == 'Linux' && matrix.toolchain == 'stable' }}
run: cargo test --workspace --features "rafx-vulkan" --manifest-path demo/Cargo.toml
env:
RUSTFLAGS: "-C debuginfo=0 -D warnings"
- name: Run tests (metal)
if: ${{ runner.os == 'macOS' && matrix.toolchain == 'stable' }}
run: cargo test --workspace --features "rafx-metal" --manifest-path demo/Cargo.toml
# SDL2 does not build warning-free on macos so we can't use -D warnings
- name: Run tests (gles2)
if: ${{ runner.os == 'Linux' && matrix.toolchain == 'stable' }}
run: cargo test --workspace --features "rafx-gles2,basic-pipeline" --manifest-path demo/Cargo.toml
env:
RUSTFLAGS: "-C debuginfo=0 -D warnings"
- name: Run tests (gles3)
if: ${{ runner.os == 'Linux' && matrix.toolchain == 'stable' }}
run: cargo test --workspace --features "rafx-gles3,basic-pipeline" --manifest-path demo/Cargo.toml
env:
RUSTFLAGS: "-C debuginfo=0 -D warnings"
deny-check:
name: cargo-deny
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
clean:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Check the format
run: cargo fmt --all -- --check
# TODO: Enable this
# - name: Run clippy
# run: >
# cargo clippy
# --all-targets
# --all-features
# --
# -D warnings