-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (139 loc) · 4.93 KB
/
Copy pathci.yml
File metadata and controls
159 lines (139 loc) · 4.93 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
name: CI
# Documentation-only changes do not run the matrix. Nothing here compiles a
# README, and runner minutes are not free -- macOS is billed at ten times the
# Linux rate. Use the manual trigger to force a run.
on:
push:
branches: [main]
tags: ['v*']
paths-ignore: &docs
- '**.md'
- 'docs/**'
- 'LICENSE'
- '.gitattributes'
- '.gitignore'
pull_request:
paths-ignore: *docs
workflow_dispatch:
# SDL3 is built from source on every platform rather than taken from a system
# package. It makes the three jobs behave the same way, and it is what makes
# the artifacts self-contained: nothing to install before running them.
env:
# COSMO_BUNDLE is on here as well as in the release workflow, so what CI
# exercises is the same shape as what ships: an application with an icon
# rather than a terminal program.
CMAKE_FLAGS: >-
-DCOSMO_WERROR=ON -DCOSMO_FETCH_SDL=ON -DCOSMO_BUNDLE=ON
-DCMAKE_BUILD_TYPE=Release
jobs:
# Single architecture on purpose. GitHub bills macOS minutes at ten times the
# Linux rate, and building both slices doubles the longest job in the
# workflow. The universal binary is a release concern rather than a
# per-commit one: `cmake --preset macos-universal` produces it locally, and
# the release job below builds it when a tag is pushed.
macos:
name: macOS (arm64)
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Configure
run: cmake -S . -B build $CMAKE_FLAGS -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0
- name: Build
run: cmake --build build -j3
- name: Test
run: ctest --test-dir build --output-on-failure
- uses: actions/upload-artifact@v7
with:
name: cosmo-macos-arm64
path: build/Cosmo.app
linux:
name: Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
# SDL3's build dependencies. Checked against a clean ubuntu:24.04
# container -- the runner image already carries some of these, but
# naming them all is what keeps this from breaking silently when the
# image changes.
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libasound2-dev libpulse-dev \
libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev \
libxi-dev libxss-dev libxtst-dev libxkbcommon-dev \
libwayland-dev wayland-protocols libdecor-0-dev \
libdrm-dev libgbm-dev libgl1-mesa-dev libegl1-mesa-dev \
libdbus-1-dev libudev-dev libibus-1.0-dev
- name: Configure
run: cmake -S . -B build $CMAKE_FLAGS
- name: Build
run: cmake --build build -j3
- name: Test
run: ctest --test-dir build --output-on-failure
- uses: actions/upload-artifact@v7
with:
name: cosmo-linux-x86_64
path: |
build/cosmo
build/cosmo1
build/cosmo2
build/cosmo3
build/imgview
windows:
name: Windows (MinGW)
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
# MinGW rather than MSVC. The game is 1992 C compiled with a forced
# include and warnings off, which both toolchains can express, but only
# the GCC side of that has been exercised -- the same toolchain is used
# to cross-compile a Windows build locally, so this is the configuration
# that is actually known to work.
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
git
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
- name: Configure
run: cmake -S . -B build -G Ninja $CMAKE_FLAGS
- name: Build
run: cmake --build build -j3
- name: Test
run: ctest --test-dir build --output-on-failure
# v0.1.0 shipped executables Windows would not start, because MinGW links
# its runtime dynamically and the DLLs were not beside them. They are
# linked in now; this is what keeps them that way.
- name: Check nothing depends on the MinGW runtime
run: |
failed=0
for exe in build/*.exe; do
if objdump -p "$exe" | grep -i 'DLL Name' | \
grep -Ei 'libgcc|libstdc\+\+|libwinpthread'; then
echo "$exe links a runtime DLL that is not shipped"
failed=1
fi
done
exit $failed
- uses: actions/upload-artifact@v7
with:
name: cosmo-windows-x86_64
path: |
build/cosmo.exe
build/cosmo1.exe
build/cosmo2.exe
build/cosmo3.exe
build/imgview.exe