-
Notifications
You must be signed in to change notification settings - Fork 144
331 lines (277 loc) Β· 10.7 KB
/
build.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
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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
name: CI build
on:
push:
branches:
- master
- godot4-meson
pull_request:
branches:
- master
- godot4-meson
# Cancel run if another commit is pushed on the branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# Global Settings
env:
PYTHON_VERSION: "3.12" # Python to run the build, no the one shipped !
BLEEDING_EDGE_GODOT: true
jobs:
static-checks:
name: 'π Static checks'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # [email protected]
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # [email protected]
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Bootstrap
run: |
set -eux
python --version
pip install pre-commit
- name: Pre-commit hooks check
run: pre-commit run --all-files --show-diff-on-failure
#################################################################################
linux-build:
name: 'π§ Linux build'
runs-on: ubuntu-latest
env:
CC: clang
LD: lld
PLATFORM: linux-x86_64
steps:
- name: 'Checkout'
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # [email protected]
with:
submodules: true
- name: 'Set up Python'
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # [email protected]
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: 'Setup venv'
run: |
set -eux
${{ env.CC }} --version
python --version
python -m pip --version
python -m pip install -r requirements.txt
- name: Download bleeding edge Godot ποΈ
uses: dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
if: ${{ env.BLEEDING_EDGE_GODOT }}
with:
repo: godotengine/godot
branch: master
event: push
workflow: linux_builds.yml
workflow_conclusion: success
name: linux-editor-mono
search_artifacts: true
check_artifacts: true
ensure_latest: true
path: godot-artifacts
- name: 'Setup bleeding edge Godot ποΈ'
id: setup-godot
if: ${{ env.BLEEDING_EDGE_GODOT }}
run: |
set -eux
GODOT_BIN=`pwd`/godot-artifacts/godot.linuxbsd.editor.x86_64.mono
GDEXTENSION_DIR=`pwd`/gdextension_api
ls godot-artifacts
chmod +x $GODOT_BIN
$GODOT_BIN --headless --version
mkdir $GDEXTENSION_DIR && pushd $GDEXTENSION_DIR
$GODOT_BIN --headless --dump-extension-api
mkdir godot && pushd godot
$GODOT_BIN --headless --dump-gdextension-interface
popd && popd
echo "EXTRA_MESON_SETUP_ARGS=-D gdextension_path=$GDEXTENSION_DIR" >> $GITHUB_OUTPUT
echo "EXTRA_RUN_TESTS_ARGS=--godot-binary=$GODOT_BIN" >> $GITHUB_OUTPUT
- name: 'Setup project'
run: python .github/scripts/meson_setup_or_dump_log.py build/ ${{ steps.setup-godot.outputs.EXTRA_MESON_SETUP_ARGS }}
- name: 'Build project'
run: meson compile -C build/
- name: 'Run tests'
run: |
set -eux
ARGS="--build-dir=build/ ${{ steps.setup-godot.outputs.EXTRA_RUN_TESTS_ARGS }} -- --headless"
python tests/run.py 0-gdscript $ARGS
python tests/run.py 1-gdextension $ARGS
python tests/run.py 2-pythonscript-init $ARGS
# TODO
# python tests/run.py 3-pythonscript-cython-only $ARGS
# - name: 'Generate artifact archive'
# run: meson compile -C build/ release
# - name: 'Export release artifact'
# uses: actions/upload-artifact@11830c9f4d30053679cb8904e3b3ce1b8c00bf40 # pin@v2
# with:
# name: ${{ env.PLATFORM }}-release
# path: 'build/godot-python-*.tar.bz2'
#################################################################################
windows-build:
name: 'π Windows build'
runs-on: windows-latest
env:
PLATFORM: 'windows-x86_64'
steps:
- name: 'Checkout'
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # [email protected]
with:
submodules: true
- name: 'Set up MSVC'
uses: egor-tensin/vs-shell@9a932a62d05192eae18ca370155cf877eecc2202 # [email protected]
- name: 'Set up Python'
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # [email protected]
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: 'Setup venv'
shell: bash
run: |
set -eux
python --version
python -m pip --version
python -m pip install -r requirements.txt
- name: Download bleeding edge Godot ποΈ
uses: dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
if: ${{ env.BLEEDING_EDGE_GODOT }}
with:
repo: godotengine/godot
branch: master
event: push
workflow: windows_builds.yml
workflow_conclusion: success
name: windows-editor
search_artifacts: true
check_artifacts: true
ensure_latest: true
path: godot-artifacts
- name: 'Setup bleeding edge Godot ποΈ'
id: setup-godot
if: ${{ env.BLEEDING_EDGE_GODOT }}
shell: bash
run: |
set -eux
# Absolute path should be used here, but Windows's path shenanigans
# prevent me from doing this :'(
GODOT_BIN=./godot-artifacts/godot.windows.editor.x86_64.exe
GDEXTENSION_DIR=./gdextension_api
ls godot-artifacts
chmod +x $GODOT_BIN
$GODOT_BIN --headless --version
mkdir $GDEXTENSION_DIR && pushd $GDEXTENSION_DIR
../$GODOT_BIN --headless --dump-extension-api
mkdir godot && pushd godot
../../$GODOT_BIN --headless --dump-gdextension-interface
popd && popd
echo "EXTRA_MESON_SETUP_ARGS=-D gdextension_path=$GDEXTENSION_DIR" >> $GITHUB_OUTPUT
echo "EXTRA_RUN_TESTS_ARGS=--godot-binary=$GODOT_BIN" >> $GITHUB_OUTPUT
- name: 'Setup project'
run: python .github/scripts/meson_setup_or_dump_log.py build/ ${{ steps.setup-godot.outputs.EXTRA_MESON_SETUP_ARGS }}
- name: 'Build project'
run: meson compile -C build/
- name: 'Run tests'
shell: bash
run: |
set -eux
ARGS="--build-dir=build/ ${{ steps.setup-godot.outputs.EXTRA_RUN_TESTS_ARGS }} --custom-gdextension-api=./gdextension_api -- --headless"
python tests/run.py 0-gdscript $ARGS
python tests/run.py 1-gdextension $ARGS
python tests/run.py 2-pythonscript-init $ARGS
# TODO
# python tests/run.py 3-pythonscript-cython-only $ARGS
# - name: 'Install Mesa3D OpenGL'
# shell: bash
# run: |
# set -eux
# # Azure pipelines doesn't provide a GPU with an OpenGL driver,
# # hence we use Mesa3D as software OpenGL driver
# pushd build/${{ matrix.PLATFORM }}/platforms/
# if [ "${{ matrix.PLATFORM }}" = "windows-64" ]
# then
# curl https://downloads.fdossena.com/Projects/Mesa3D/Builds/MesaForWindows-x64-20.0.7.7z -o mesa.7z
# else
# curl https://downloads.fdossena.com/Projects/Mesa3D/Builds/MesaForWindows-20.0.7.7z -o mesa.7z
# fi
# # opengl32.dll must be extracted in the same directory than Godot binary
# 7z.exe x mesa.7z
# ls -lh opengl32.dll # Sanity check
# popd
# - name: 'Run tests'
# run: python tests/run.py --build-dir build/ --godot-binary ${{ GODOT_BINARY_VERSION }}
# - name: 'Generate artifact archive'
# run: meson compile -C build/ release
# - name: 'Export release artifact'
# uses: actions/upload-artifact@11830c9f4d30053679cb8904e3b3ce1b8c00bf40 # pin@v2
# with:
# name: ${{ matrix.PLATFORM }}-release
# path: 'build/godot-python-*.zip'
#################################################################################
# TODO
# macos-build:
# name: 'π macOS build'
# runs-on: macos-latest
# env:
# CC: clang
# LD: lld
# PLATFORM: 'macos-x86_64'
# steps:
# - name: 'Checkout'
# uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # [email protected]
# with:
# submodules: true
# - name: 'Set up Python'
# uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # [email protected]
# with:
# python-version: ${{ env.PYTHON_VERSION }}
# - name: 'Setup venv'
# run: |
# set -eux
# ${{ env.CC }} --version
# python --version
# pip install -U pip
# pip install -r requirements.txt
# - name: 'Setup project'
# run: python .github/scripts/meson_setup_or_dump_log.py build/
# - name: 'Build project'
# run: meson compile -C build/
# TODO: see https://github.com/touilleMan/godot-python/issues/358
# - name: 'Run tests'
# run: python tests/run.py 0-pythonscript-init --build-dir build/ -- --headless
# - name: 'Generate artifact archive'
# run: meson compile -C build/ release
# - name: 'Export release artifact'
# uses: actions/upload-artifact@11830c9f4d30053679cb8904e3b3ce1b8c00bf40 # pin@v2
# with:
# name: ${{ env.PLATFORM }}-release
# path: 'build/godot-python-*.tar.bz2'
#################################################################################
# publish-release:
# name: 'Publish ${{ matrix.PLATFORM }} release'
# if: startsWith(github.ref, 'refs/tags/v')
# runs-on: ubuntu-latest
# needs:
# - linux-build
# - windows-build
# - macos-build
# strategy:
# matrix:
# include:
# - PLATFORM: linux-x86_64
# - PLATFORM: windows-x86_64
# - PLATFORM: windows-x86
# - PLATFORM: osx-x86_64
# steps:
# - uses: actions/download-artifact@0ede0875b5db9a2824878bbbbe3d758a75eb8268 # pin@v2
# name: ${{ matrix.PLATFORM }}-release
# - name: 'Upload release'
# uses: svenstaro/upload-release-action@483c1e56f95e88835747b1c7c60581215016cbf2 # pin@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# tag: ${{ github.ref }}
# file: godot-python-*.*
# file_glob: true
# overwrite: true