-
Notifications
You must be signed in to change notification settings - Fork 0
260 lines (227 loc) · 9.32 KB
/
builds.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
name: xr-grid-shader Builds
on:
push:
branches:
- main
pull_request:
env:
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
EM_VERSION: 3.1.18
EM_CACHE_FOLDER: "emsdk-cache"
concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-deploy
cancel-in-progress: true
jobs:
build-linux:
runs-on: "ubuntu-20.04"
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: linux_editor_win_deploy
cache-name: linux-editor-deploy-windows-editor
target: editor
tests: false
sconsflags: use_llvm=yes linker=gold deprecate=no
doc-test: false
bin: "./bin/godot.linuxbsd.editor.x86_64.llvm"
deploy-bin: "./bin/godot.windows.editor.x86_64.llvm.exe"
proj-conv: false
artifact: true
platform: linuxbsd
deploy: true
deploy-platform: windows
deploy-platform-target: editor
- name: linux_editor_linux_deploy
cache-name: linux-editor-deploy-linux-editor
target: editor
tests: false
sconsflags: use_llvm=yes linker=gold deprecate=no
doc-test: false
bin: "./bin/godot.linuxbsd.editor.x86_64.llvm"
deploy-bin: "./bin/godot.linuxbsd.editor.x86_64.llvm"
proj-conv: false
artifact: true
platform: linuxbsd
deploy: true
deploy-platform: linux
deploy-platform-target: editor
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3.5.2
- name: Linux dependencies for gold linker
run: |
sudo apt-get install -qq binutils
- name: Setup Godot build cache
uses: ./.github/actions/godot-cache
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: Set up Emscripten latest
if: ${{ matrix.platform == 'web' }}
uses: mymindstorm/setup-emsdk@ab889da2abbcbb280f91ec4c215d3bb4f3a8f775 # v12
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
- name: Verify Emscripten setup
if: ${{ matrix.platform == 'web' }}
run: |
emcc -v
- name: Setup python and scons
uses: ./.github/actions/godot-deps
- name: Set up .NET Sdk
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
if: ${{ matrix.build-mono }}
with:
dotnet-version: "6.0.x"
- name: Setup GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@d1fed1fac9e94d30e23b5a82dba4e2963e71d2e7 # master
- name: Compilation
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
platform: ${{ matrix.platform }}
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
deploy: ${{ matrix.deploy }}
deploy-platform: ${{ matrix.deploy-platform }}
deploy-platform-target: ${{ matrix.deploy-platform-target }}
- name: Generate build constants
uses: ./.github/actions/vsk-generate-constants
- name: Export Game
if: ${{ matrix.deploy }}
run: |
mkdir -p .godot/editor .godot/imported export_linux
chmod +x ${{ matrix.bin }}
${{ matrix.bin }} --headless --xr-mode off --export-pack Linux `pwd`/vsekai_game_${{ matrix.deploy-platform }}.pck --path . || true
timeout-minutes: 10
- name: Prepare artifacts
if: ${{ matrix.deploy && matrix.deploy-platform == 'windows' }}
run: |
rm -rf vsekai_game_${{ matrix.deploy-platform }}
export TARGET=vsekai_game_${{ matrix.deploy-platform }}
mkdir -p $TARGET
cp -rf ${{ matrix.deploy-bin }} $TARGET/vsekai_game_${{ matrix.deploy-platform }}.exe
cp -rf vsekai_game_${{ matrix.deploy-platform }}.pck $TARGET/vsekai_game_${{ matrix.deploy-platform }}.pck
7z a -r $TARGET.zip $TARGET
shell: bash
- name: Prepare artifacts
if: ${{ matrix.deploy && matrix.deploy-platform != 'windows' }}
run: |
rm -rf vsekai_game_${{ matrix.deploy-platform }}
export TARGET=vsekai_game_${{ matrix.deploy-platform }}
mkdir -p $TARGET
cp -rf ${{ matrix.deploy-bin }} $TARGET/vsekai_game_${{ matrix.deploy-platform }}
cp -rf vsekai_game_${{ matrix.deploy-platform }}.pck $TARGET/vsekai_game_${{ matrix.deploy-platform }}.pck
7z a -r $TARGET.zip $TARGET
shell: bash
- name: Upload Godot Artifact Export
if: ${{ matrix.deploy }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: vsekai_game_${{ matrix.deploy-platform }}_x86_64
path: |
vsekai_game_${{ matrix.deploy-platform }}
- name: Generate C# glue
if: ${{ matrix.build-mono }}
run: |
${{ matrix.bin }} --headless --generate-mono-glue ./modules/mono/glue || true
- name: Build .NET solutions
if: ${{ matrix.build-mono }}
run: |
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd
- name: Unit tests
if: ${{ matrix.tests }}
run: |
${{ matrix.bin }} --version
${{ matrix.bin }} --help
${{ matrix.bin }} --test --headless
- name: Check for class reference updates
if: ${{ matrix.doc-test }}
run: |
echo "Running --doctool to see if this changes the public API without updating the documentation."
echo -e "If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.\n\n"
${{ matrix.bin }} --doctool --headless 2>&1 > /dev/null || true
git diff --color --exit-code && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$'
- name: Test project converter
if: ${{ matrix.proj-conv }}
run: |
mkdir -p converter_test
cd converter_test
touch project.godot
${{ matrix.bin }} --headless --validate-conversion-3to4
cd ..
rm converter_test -rf
- name: Open and close editor (Vulkan)
if: ${{ matrix.proj-test }}
run: |
xvfb-run ${{ matrix.bin }} --audio-driver Dummy --editor --quit --path test_project 2>&1 | tee sanitizers_log.txt || true
misc/scripts/check_ci_log.py sanitizers_log.txt
- name: Open and close editor (GLES3)
if: ${{ matrix.proj-test }}
run: |
DRI_PRIME=0 xvfb-run ${{ matrix.bin }} --audio-driver Dummy --rendering-driver opengl3 --editor --quit --path test_project 2>&1 | tee sanitizers_log.txt || true
misc/scripts/check_ci_log.py sanitizers_log.txt
- name: Run project
if: ${{ matrix.proj-test }}
run: |
xvfb-run ${{ matrix.bin }} 40 --audio-driver Dummy --path test_project 2>&1 | tee sanitizers_log.txt || true
misc/scripts/check_ci_log.py sanitizers_log.txt
- name: Prepare artifact
if: ${{ matrix.artifact }}
run: |
chmod +x godot/bin/godot.* || true
chmod +x godot/bin/libgodot.* || true
- name: Upload artifact
uses: ./.github/actions/upload-artifact
if: ${{ matrix.artifact }}
with:
name: ${{ matrix.cache-name }}
release:
needs: build-linux
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Assets
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs');
const path = require('path');
const artifacts = ['vsekai_game_windows_x86_64.zip', 'vsekai_game_linux_x86_64.zip'];
for (const artifact of artifacts) {
const filePath = path.join(process.env.GITHUB_WORKSPACE, artifact);
if (fs.existsSync(filePath)) {
await github.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: context.payload.release.id,
name: path.basename(artifact),
data: fs.readFileSync(filePath),
headers: {
'content-length': fs.statSync(filePath).size,
'content-type': 'application/zip',
},
});
}
}