forked from DoubleStyx/Renderide
-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (164 loc) · 6.13 KB
/
Copy pathci.yml
File metadata and controls
193 lines (164 loc) · 6.13 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
184
185
186
187
188
189
190
191
192
193
# Builds the Rust workspace and the .NET generator solution on all major desktop OSes.
name: CI
"on":
push:
branches: [master]
paths:
- ".github/workflows/ci.yml"
- ".taplo.toml"
- "Cargo.lock"
- "Cargo.toml"
- "Generators.sln"
- "clippy.toml"
- "crates/**"
- "generators/**"
- "third_party/**"
pull_request:
paths:
- ".github/workflows/ci.yml"
- ".taplo.toml"
- "Cargo.lock"
- "Cargo.toml"
- "Generators.sln"
- "clippy.toml"
- "crates/**"
- "generators/**"
- "third_party/**"
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
# Quiet first-run telemetry/welcome banners on hosted runners.
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
DOTNET_NOLOGO: "1"
jobs:
rust:
name: Rust / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux is the only runner where GStreamer dev packages are reliably installable
# via the system package manager, so it's the only OS that exercises the
# `video-textures` feature (which pulls in gstreamer-sys / glib-sys).
# `--all-features` here also enables `tracy`, giving us lint coverage of that path.
- os: ubuntu-latest
clippy_features: "--all-features"
- os: windows-latest
clippy_features: ""
- os: macos-latest
clippy_features: ""
steps:
- uses: actions/checkout@v4
# `materials::registry` wgpu smoke test requires an adapter when `CI` is set (GitHub sets it by default).
# GStreamer dev packages are required only when the `video-textures` feature is enabled
# (Linux clippy does this via `--all-features`); pkg-config resolves the headers/libs at build time.
- name: Install Linux system dependencies (Vulkan + GStreamer)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
mesa-vulkan-drivers vulkan-tools \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Enable sccache (Windows)
if: runner.os == 'Windows'
uses: mozilla-actions/sccache-action@v0.0.9
- name: Configure sccache (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
echo "SCCACHE_GHA_ENABLED=true" >>"${GITHUB_ENV}"
echo "RUSTC_WRAPPER=sccache" >>"${GITHUB_ENV}"
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
cache-bin: "false"
- name: Verify Rust toolchain
shell: bash
run: |
set -euo pipefail
command -v cargo
command -v rustup
rustup show active-toolchain
cargo metadata --locked --no-deps --format-version 1 >/dev/null
- name: Check formatting
run: cargo fmt --all -- --check
- uses: uncenter/setup-taplo@v2
with:
version: "0.10.0"
- name: Check TOML formatting (taplo)
run: taplo fmt --check --diff
- name: Clippy
run: cargo clippy --all-targets --locked ${{ matrix.clippy_features }} -- -D warnings
- name: Check Tracy feature
if: runner.os != 'Linux'
run: cargo check --locked -p renderide --features tracy
- name: cargo build
run: cargo build --locked -p renderide -p renderide-test -p bootstrapper
- name: cargo test
run: cargo test --workspace --locked
- name: Run headless renderer suite
shell: bash
run: |
set -euo pipefail
if [[ "${RUNNER_OS}" == "Windows" ]]; then
./target/debug/renderide-test.exe check-suite
else
./target/debug/renderide-test check-suite
fi
- name: Upload headless suite artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: headless-renderer-suite-${{ matrix.os }}
path: |
target/renderide-test-out/**
logs/renderer-test/**
logs/renderer/**
- name: Show sccache stats (Windows)
if: always() && runner.os == 'Windows'
shell: bash
run: |
if [[ -n "${SCCACHE_PATH:-}" ]]; then
"${SCCACHE_PATH}" --show-stats
fi
dotnet:
name: .NET / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0"
# Restores NuGet global-packages folder between runs (keyed on dependency manifests).
cache: true
cache-dependency-path: |
generators/**/packages.lock.json
- name: Restore
run: dotnet restore Generators.sln --locked-mode
# `dotnet format` can be sensitive to the runner's git line-ending behavior (e.g. Windows
# `core.autocrlf=true`), so verify formatting only on Linux where checkouts match in-repo encoding.
- name: Verify formatting
if: runner.os == 'Linux'
run: dotnet format Generators.sln --verify-no-changes --no-restore
# `-warnaserror` promotes every compiler / analyzer warning to a build error;
# combined with `latest-recommended` analyzers in the project files this gates
# CI on a clean, warning-free build.
- name: Build (warnings as errors)
run: dotnet build generators/SharedTypeGenerator.Tests/SharedTypeGenerator.Tests.csproj --configuration Release --no-restore -warnaserror
# Hosted runners do not have the host shared assembly: roundtrip sources are excluded at compile time (see SharedTypeGenerator.Tests.csproj).
- name: Test
run: dotnet test generators/SharedTypeGenerator.Tests/SharedTypeGenerator.Tests.csproj --configuration Release --no-build --no-restore