forked from endless-sky/endless-sky
-
Notifications
You must be signed in to change notification settings - Fork 0
205 lines (191 loc) · 7.12 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
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
name: CI
on:
push:
# Run for pushes to master or a release branch, e.g. a PR was merged ...
branches:
- master
- releases/v[0-9]+.[0-9]+.[0-9]+
# ... and only when we've possibly changed how the game will function.
paths:
- 'source/**'
- 'data/**'
- 'tests/**'
- '.github/workflows/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- keys.txt
pull_request:
# Run for any push to any pull request, if it modifies source code or game text.
types: [opened, synchronize]
paths:
- 'source/**'
- 'data/**'
- 'tests/**'
- '.github/workflows/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- keys.txt
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
# Figure out what changed, so other jobs in this file can conditionally execute.
changed:
uses: ./.github/workflows/compute-changes.yml
build_ubuntu:
name: Ubuntu
needs: changed
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.unit_tests == 'true' || needs.changed.outputs.integration_tests == 'true' || needs.changed.outputs.cmake_files == 'true' }}
runs-on: ubuntu-${{ matrix.os }}
strategy:
matrix:
os: [20.04, 22.04]
opengl: [GL, GLES]
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Install development dependencies
run: |
sudo rm /etc/apt/sources.list.d/* && sudo dpkg --clear-avail # Speed up installation and get rid of unwanted lists
sudo apt-get update
sudo apt-get install -y --no-install-recommends libxmu-dev libxi-dev libgl-dev libglu1-mesa-dev libgles2-mesa-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libosmesa6 mesa-utils libglvnd-dev x11-utils
- name: Disable VM sound card
run: |
sudo sh -c 'echo "pcm.!default { type plug slave.pcm \"null\" }" >> /etc/asound.conf'
- name: Setup sccache
uses: ./.github/sccache
- uses: lukka/get-cmake@latest
- uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: '2cf957350da28ad032178a974607f59f961217d9'
- uses: lukka/run-cmake@v10
with:
configurePreset: ${{ matrix.opengl == 'GL' && 'linux-ci' || 'linux-gles-ci' }}
buildPreset: ${{ matrix.opengl == 'GL' && 'linux-ci' || 'linux-gles-ci' }}
testPreset: ${{ matrix.opengl == 'GL' && 'linux-ci' || 'linux-gles-ci' }}
- name: Run Benchmarks
run: ctest --preset ${{ matrix.opengl == 'GL' && 'linux-ci-benchmark' || 'linux-gles-ci-benchmark' }}
build_windows:
name: Windows
needs: changed
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.unit_tests == 'true' || needs.changed.outputs.cmake_files == 'true' }}
runs-on: windows-2022
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Setup sccache
uses: ./.github/sccache
- uses: lukka/get-cmake@latest
- uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: '2cf957350da28ad032178a974607f59f961217d9'
- uses: lukka/run-cmake@v10
with:
configurePreset: 'mingw-ci'
buildPreset: 'mingw-ci'
testPreset: 'mingw-ci'
- name: Run Benchmarks
run: ctest --preset mingw-ci-benchmark
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: binary-windows
path: ./build/ci/Endless Sky.exe
- name: Upload DLLs
uses: actions/upload-artifact@v3
with:
name: windows-dlls
path: ./build/ci/*.dll
build_windows_clang:
name: Windows Clang
needs: changed
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.unit_tests == 'true' || needs.changed.outputs.cmake_files == 'true' }}
runs-on: windows-2022
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Setup sccache
uses: ./.github/sccache
- uses: lukka/get-cmake@latest
- uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: '2cf957350da28ad032178a974607f59f961217d9'
- uses: lukka/run-cmake@v10
with:
configurePreset: 'clang-cl-ci'
buildPreset: 'clang-cl-ci'
testPreset: 'clang-cl-ci'
- name: Run Benchmarks
run: ctest --preset clang-cl-ci-benchmark
build_macos:
name: MacOS
needs: changed
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.unit_tests == 'true' || needs.changed.outputs.cmake_files == 'true' }}
runs-on: macos-12
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Setup sccache
uses: ./.github/sccache
- name: Install pkg-config
run: type -P pkg-config || brew install pkg-config
- uses: lukka/get-cmake@latest
- uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: '2cf957350da28ad032178a974607f59f961217d9'
- uses: lukka/run-cmake@v10
with:
configurePreset: 'macos-ci'
buildPreset: 'macos-ci'
testPreset: 'macos-ci'
- name: Run Benchmarks
run: ctest --preset macos-ci-benchmark
test-parse:
needs: [changed, build_windows]
name: Data Files
if: ${{ (needs.changed.outputs.game_code == 'true' || needs.changed.outputs.cmake_files == 'true' || needs.changed.outputs.data == 'true' || needs.changed.outputs.integration_tests == 'true' || needs.changed.outputs.parse_script == 'true') && always() }}
runs-on: windows-2022
env:
CONTINUOUS: EndlessSky-win64-continuous.zip
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
# If no code changes occurred then we can download the latest continuous.
- name: Download latest continuous
if: ${{ needs.changed.outputs.game_code != 'true' && needs.changed.outputs.cmake_files != 'true' }}
run: gh release download -R ${{ github.repository }} continuous -p ${{ env.CONTINUOUS }}
- name: Extract and prepare continuous
if: ${{ needs.changed.outputs.game_code != 'true' && needs.changed.outputs.cmake_files != 'true' }}
run: |
Expand-Archive ${{ env.CONTINUOUS }} -DestinationPath continuous -Force
COPY '.\continuous\Endless Sky.exe' .
COPY '.\continuous\*.dll' .
# Otherwise download the binary from CI.
- name: Download game binary from CI
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.cmake_files == 'true' }}
uses: actions/download-artifact@v3
with:
name: binary-windows
- name: Download DLLs from CI
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.cmake_files == 'true' }}
uses: actions/download-artifact@v3
with:
name: windows-dlls
- name: Parse Datafiles
run: .\utils\test_parse.ps1 'Endless Sky.exe'
- name: Parse Integration Test Data
run: .\utils\test_parse.ps1 'Endless Sky.exe' tests/integration/config