GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Kinetra-Lab/.github/workflows/ci.yml at main · SMB-M87/Kinetra-Lab

Expand file tree

/

ci.yml

Copy path
View runs
More file actions
More file actions

Latest commit

 

History

History
History
265 lines (243 loc) · 13.3 KB
/

ci.yml

Copy path

File metadata and controls

265 lines (243 loc) · 13.3 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# Checks pull requests on Ubuntu 24.04 LTS using the distribution's GCC, CMake and SDL2.
# Formatting uses a pinned clang-format from PyPI. Update CLANG_FORMAT_VERSION in both
# CI workflows and clang_format_version in Kinetra's tools/cloud_setup.sh together.
# Package installation uses the Azure mirror with a bounded fallback to the image's sources.
# Keep the workflow name "CI" and required status job "checks" stable.
# The separate Windows job uses MSYS2's MinGW-w64 GCC.
name: CI
on:
pull_request:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CLANG_FORMAT_VERSION: "23.1.5"
jobs:
# Decides whether this pull request can change the build or the tests, with the decision
# of the release workflow (tools/release/needs_build.sh): not when Lab changed only
# Markdown, docs/ or .agents/, apart from README.md, docs/media/ and the blueprints, which
# a test reads or the build copies, and a moved Kinetra pointer brings only Markdown,
# docs/, .agents/, .claude/, .codex/config.toml, .github/ or tools/, apart from Kinetra's
# README.md and docs/media/, which a test reads. Then the build and test
# jobs below are skipped, only the docs check runs here, and "checks" passes on this job's
# result. A pull request that only moves the pointer to a commit off Kinetra main is not a
# pointer-only one, which merges without review: it builds in full, with a warning. The
# decision is needs_build.sh from the base branch's tip, so a pull request cannot decide
# its own CI with a changed script and an older branch decides with the newest filter; a
# pull request that changes the script must also make its own copy decide to build. Any
# doubt, such as a failed Kinetra fetch, means a full run. A failure of this job, its docs
# check, a broken decision or a broken script, fails "checks" too, and the full run still
# runs to show the build.
changes:
runs-on: ubuntu-24.04
timeout-minutes: 10
outputs:
skip_build: ${{ steps.decide.outputs.skip_build }}
steps:
- uses: actions/checkout@v7
with:
# The decision needs commits and trees, not the contents of old files such as the
# tour videos that were once in docs/media.
fetch-depth: 0
filter: blob:none
- name: Decide whether build and tests are needed
id: decide
env:
BASE: ${{ github.event.pull_request.base.sha }}
HEAD: ${{ github.event.pull_request.head.sha }}
run: |
# An early exit leaves skip_build empty, which the jobs below read as a full run.
git cat-file -e "$HEAD" 2>/dev/null || git fetch -q origin "$HEAD" || true
if ! mb=$(git merge-base "$BASE" "$HEAD" 2>/dev/null); then
echo "::warning title=No merge base::Could not find the merge base of $BASE and $HEAD; the full CI runs."
exit 0
fi
# --no-renames, as in needs_build.sh: a rename lists both its old and its new path.
if [ "$(git diff --no-renames --name-only "$mb" "$HEAD")" = "external/Kinetra" ]; then
new=$(git rev-parse "$HEAD:external/Kinetra")
url=$(git config -f .gitmodules submodule.external/Kinetra.url || true)
kinetra="$RUNNER_TEMP/kinetra"
if ! git clone -q --filter=blob:none --no-checkout "$url" "$kinetra"; then
echo "::warning title=Pointer not checked::Could not clone Kinetra from '$url'; the full CI runs."
exit 0
fi
# A Lab pull request that follows a Kinetra pull request in review can hold only
# the pointer. It still runs full CI and merges after Kinetra.
if ! git -C "$kinetra" merge-base --is-ancestor "$new" origin/main; then
echo "::warning title=Pointer not on Kinetra main::$new is not on Kinetra main, so this is not a pointer-only pull request: it merges after its Kinetra pull request. The full CI runs."
exit 0
fi
fi
# A pull request that changes the script must make its own copy decide to build it,
# since the script is not documentation; otherwise the broken copy would decide every
# pull request after the merge.
if grep -q -x 'tools/release/needs_build.sh' <<< "$(git diff --no-renames --name-only "$mb" "$HEAD")"; then
if [ "$(bash tools/release/needs_build.sh "$mb" "$HEAD")" != true ]; then
echo "::error title=needs_build.sh broken::This pull request changes tools/release/needs_build.sh, and its own copy does not decide to build it."
exit 1
fi
fi
# The base branch's tip decides: its copy is merged and the newest, so a pull request
# cannot skip its own build with a changed script, and an older branch does not keep
# its fork point's filter.
decide="$RUNNER_TEMP/needs_build.sh"
git cat-file -e "$BASE" 2>/dev/null || git fetch -q origin "$BASE" || true
if ! git show "$BASE:tools/release/needs_build.sh" > "$decide"; then
echo "::warning title=No decision script::Could not read tools/release/needs_build.sh at the base branch's tip $BASE: the file is missing there, or fetching it failed. The full CI runs."
exit 0
fi
skip=false
if [ "$(bash "$decide" "$mb" "$HEAD")" = false ]; then
skip=true
echo "::notice title=Build and tests skipped::This pull request cannot change the build: only the docs check runs."
fi
echo "skip_build=$skip" >> "$GITHUB_OUTPUT"
- name: Documentation links (no build needed)
if: steps.decide.outputs.skip_build == 'true'
run: |
git submodule update --init --recursive
python3 external/Kinetra/tools/check_docs.py
linux:
needs: changes
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.skip_build != 'true') }}
runs-on: ubuntu-24.04
# A run takes about eight minutes.
timeout-minutes: 45
container: ubuntu:24.04
defaults:
run:
shell: bash
steps:
- name: Install Ubuntu's packages
# About half a minute from the mirror. archive.ubuntu.com, the image's source, once
# served a run so slowly that this step was still downloading after an hour.
timeout-minutes: 15
env:
DEBIAN_FRONTEND: noninteractive
run: |
# The Debian and Ubuntu package set of the README's quick start, which
# tools/cloud_setup.sh installs in a cloud session too, plus git for the checkout and
# the submodule, and venv for clang-format.
packages="build-essential cmake ninja-build ccache libsdl2-dev libgl-dev libegl-dev libgl1-mesa-dri libegl-mesa0 nlohmann-json3-dev git ca-certificates python3-venv"
# Canonical's mirror inside Azure, where the runners run, serves the same archive.
# The copy of the image's sources stays outside sources.list.d, where apt would
# report its extension.
sources=/etc/apt/sources.list.d/ubuntu.sources
cp "$sources" /etc/apt/ubuntu.sources.image
sed -i -E 's#^URIs: http://(archive|security)\.ubuntu\.com/ubuntu/?$#URIs: http://azure.archive.ubuntu.com/ubuntu/#' "$sources"
grep '^URIs:' "$sources"
# The pattern matches the URIs of today's image; one it misses, say a later image's
# https://, would otherwise go unnoticed.
if grep -q -v -x 'URIs: http://azure\.archive\.ubuntu\.com/ubuntu/' <<< "$(grep '^URIs:' "$sources")"; then
echo "::warning title=Ubuntu mirror not used::A URI of the image's ubuntu.sources does not match this step's pattern, so this run installs from that source instead of the Azure mirror."
fi
apt_install() { apt-get install -y --no-install-recommends $packages; }
# The mirror gets 90 seconds of the step's 15 minutes to deliver the indexes and the
# packages, which took about ten seconds in the runs measured on 2026-11-26; a stalled
# download then costs a run two minutes, not five and a half. A mirror that does not
# answer, or stalls a download, would otherwise spend the 15 minutes on apt's timeouts
# and retries, and the fallback would never start. timeout bounds only the update and
# --download-only, which run no dpkg; the install from the downloaded packages has no
# budget, because a killed apt-get install can leave dpkg half-configured. timeout
# runs a program, not a shell function: hence bash -c and the exported list. apt-get
# update succeeds when an index fails to download; Error-Mode=any makes the mirror's
# update fail then, so a run never installs from a partial package list.
export packages
if ! { timeout -k 10 90 bash -c 'apt-get update -o APT::Update::Error-Mode=any && apt-get install -y --no-install-recommends --download-only $packages' && apt_install; }; then
echo "::warning title=Ubuntu mirror not used::The Azure mirror of the Ubuntu archive failed or did not deliver the indexes and packages within 90 seconds, so this run installs from the image's own sources."
cp /etc/apt/ubuntu.sources.image "$sources"
apt-get update
apt_install
fi
- name: Tool versions
run: |
# sed reads all of its input: with head, the writer can die of SIGPIPE, and the
# step shell's pipefail turns that into a failure (exit code 141).
command -v gcc cmake ctest ninja
gcc --version | sed -n 1p; cmake --version | sed -n 1p; ninja --version; ldd --version | sed -n 1p
- uses: actions/checkout@v7
- name: Trust the workspace and fetch the Kinetra submodule
run: |
git config --global --add safe.directory '*'
git submodule update --init --recursive
git submodule status
- name: Install pinned clang-format
timeout-minutes: 5
run: |
python3 -m venv "$RUNNER_TEMP/clang-format"
"$RUNNER_TEMP/clang-format/bin/python" -m pip install --only-binary=:all: "clang-format==$CLANG_FORMAT_VERSION"
echo "$RUNNER_TEMP/clang-format/bin" >> "$GITHUB_PATH"
- name: Format check (clang-format)
run: |
clang-format --version
git ls-files -- '*.h' '*.cpp' | xargs clang-format --dry-run --Werror
- name: Documentation links
run: python3 external/Kinetra/tools/check_docs.py
- name: Headless build and test (application logic without SDL2/OpenGL)
run: cmake --workflow --preset headless
- name: Full build and test (applications, engine warnings as errors, graphics tests and smoke runs with software OpenGL)
run: cmake --workflow --preset ci
# The required status. It passes when both "changes" and "linux" passed, or when "changes" decided that the pull request cannot change the build
# and ran the docs check itself. Any other outcome, a failed "changes" job (a broken
# decision, a broken needs_build.sh or a failed docs check) or a failed or cancelled
# "linux" run included, fails it.
checks:
needs: [changes, linux]
# always(), not !cancelled(): a skipped required job counts as passed, so on a
# cancelled run this job must still run and fail.
if: ${{ always() }}
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Linux passed or the documentation check passed
env:
CHANGES: ${{ needs.changes.result }}
SKIP: ${{ needs.changes.outputs.skip_build }}
LINUX: ${{ needs.linux.result }}
run: |
echo "changes: $CHANGES, skip_build: $SKIP, linux: $LINUX"
if [ "$CHANGES" = success ] && [ "$SKIP" = true ] && [ "$LINUX" = skipped ]; then
exit 0
fi
if [ "$CHANGES" != success ]; then
echo "::error title=changes failed::The changes job failed; its log says why."
exit 1
fi
test "$LINUX" = success
windows:
needs: changes
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.skip_build != 'true') }}
runs-on: windows-latest
# A run takes about seven minutes.
timeout-minutes: 45
defaults:
run:
shell: msys2 {0}
steps:
- name: Keep line endings as committed
shell: pwsh
run: git config --global core.autocrlf false
- uses: actions/checkout@v7
# About a minute. It updates MSYS2 and installs from MSYS2's mirrors, which can stall
# like any download.
- uses: msys2/setup-msys2@v2
timeout-minutes: 15
with:
msystem: UCRT64
update: true
install: >-
git
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-ninja
mingw-w64-ucrt-x86_64-SDL2
mingw-w64-ucrt-x86_64-nlohmann-json
- name: Fetch the Kinetra submodule
run: |
git config --global --add safe.directory '*'
git submodule update --init --recursive
gcc --version | head -1; cmake --version | head -1
- name: Build and test on Windows (MinGW-w64, graphics tests compiled, engine warnings as errors)
run: cmake --workflow --preset windows-native
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.