File tree Expand file tree Collapse file tree 3 files changed +65
-1
lines changed Expand file tree Collapse file tree 3 files changed +65
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Setup Godot
2
+ description : Setup Godot dependencies.
3
+ runs :
4
+ using : " composite"
5
+ steps :
6
+
7
+ - name : Installing Linux dependencies
8
+ if : ${{ runner.os == 'Linux' }}
9
+ shell : bash
10
+ run : sudo apt-get install -y pulseaudio xvfb x11-xserver-utils mesa-vulkan-drivers
11
+
12
+ - name : Starting X11 server on :0
13
+ if : ${{ runner.os == 'Linux' }}
14
+ shell : bash
15
+ run : xset -q || /bin/bash -c "sudo Xvfb -ac :0 -screen 0 1920x1080x24 > /dev/null 2>&1 &"
16
+ env :
17
+ DISPLAY : " :0"
18
+
19
+ - name : Check that X11 server is running
20
+ if : ${{ runner.os == 'Linux' }}
21
+ uses : nick-fields/retry@v2
22
+ with :
23
+ timeout_minutes : 1
24
+ max_attempts : 5
25
+ command : /bin/bash -c "xset -q > /dev/null 2>&1"
26
+ env :
27
+ DISPLAY : " :0"
28
+
29
+ - name : Starting dummy sound device
30
+ if : ${{ runner.os == 'Linux' }}
31
+ uses : nick-fields/retry@v2
32
+ with :
33
+ timeout_minutes : 1
34
+ max_attempts : 3
35
+ command : pulseaudio --check || pulseaudio -D
Original file line number Diff line number Diff line change 44
44
- name : Load dotenv
45
45
run : just ci-load-dotenv
46
46
47
+ - name : Setup Godot dependencies
48
+ uses : ./.github/actions/setup-godot
49
+
47
50
- name : Export
48
51
run : just export
49
52
68
71
- name : Load dotenv
69
72
run : just ci-load-dotenv
70
73
74
+ - name : Setup Godot dependencies
75
+ uses : ./.github/actions/setup-godot
76
+
71
77
- name : Export
72
78
run : just export-web
73
79
Original file line number Diff line number Diff line change @@ -129,7 +129,12 @@ import-resources:
129
129
130
130
# Godot binary wrapper
131
131
@ godot * ARGS : makedirs install-godot install-templates
132
- {{ godot_bin }} {{ ARGS }}
132
+ #!/usr/bin/env sh
133
+ if [ " {{ env (" CI" , " false" ) }} " = " true" ]; then
134
+ just ci-godot-x11 {{ ARGS }}
135
+ else
136
+ {{ godot_bin }} {{ ARGS }}
137
+ fi
133
138
134
139
# Open the Godot editor
135
140
editor :
@@ -196,6 +201,24 @@ ci-load-dotenv:
196
201
echo " game_name={{ game_name }} " >> $GITHUB_ENV
197
202
echo " game_version={{ game_version }} " >> $GITHUB_ENV
198
203
204
+ # Starts godot using Xvfb and pulseaudio
205
+ ci-godot-x11 * ARGS :
206
+ #!/ bin/ bash
207
+ set -e
208
+ # Set locale to 'en' if locale is not already set.
209
+ # Godot will fallback to this locale anyway and it
210
+ # prevents an error message being printed to console.
211
+ [ " $LANG" == " C.UTF-8" ] && LANG=en || true
212
+
213
+ # Start dummy sound device.
214
+ pulseaudio --check || pulseaudio -D
215
+
216
+ # Running godot with X11 Display.
217
+ xvfb-run --auto-servernum {{ godot_bin }} {{ ARGS }}
218
+
219
+ # Cleanup (allowed to fail).
220
+ pulseaudio -k || true
221
+
199
222
# Download Butler
200
223
[private ]
201
224
install-butler : makedirs
You can’t perform that action at this time.
0 commit comments