Skip to content

Commit cafca17

Browse files
authored
chore: enable tests in pipeline (#98)
* chore: enable tests in pipeline * fix: issue with wrong tests arg for compilation * fix: issue with missing node_modules * chore: update from main * chore: update test project * fix: issue with workflow files * fix: issue with workflow file * fix: issues with tests for editor * fix: issue with sconsflags * fix: issue with skipping changesets * fix: issue with tests * fix: exclude QuickJS from CICD - it isn't working at the moment * fix: issue with macos build * chore: removed package-lock.json
1 parent 3b630d6 commit cafca17

38 files changed

+92301
-311
lines changed

.github/workflows/build_android.yml

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,15 @@ env:
3434
jobs:
3535
build-android:
3636
runs-on: ubuntu-24.04
37-
name: ${{ matrix.name }}
37+
name: Android (${{ matrix.target }}, ${{ matrix.engine }})
3838
timeout-minutes: 60
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
include:
43-
- name: Template (target=template_release, arch=arm64, v8)
44-
cache-name: android-template-release-${{inputs.version}}-v8
45-
target: template_release
46-
tests: false
47-
sconsflags: ${{ inputs.version == '4.4' && 'deprecated=no ndk_platform=android-24 generate_apk=yes' || '' }}
48-
cache-limit: 1
49-
50-
- name: Template (target=template_release, arch=arm64, qjs_ng)
51-
cache-name: android-template-release-${{inputs.version}}-qjs-ng
52-
target: template_release
53-
tests: false
54-
sconsflags: use_quickjs_ng=yes
55-
cache-limit: 1
42+
# QuickJS isn't working at the moment
43+
# engine: [ v8, qjs-ng ]
44+
engine: [v8]
45+
target: [template_release, template_debug]
5646

5747
steps:
5848
- name: Checkout Godot
@@ -78,7 +68,7 @@ jobs:
7868
- name: Restore Godot build cache
7969
uses: ./.github/actions/godot-cache-restore
8070
with:
81-
cache-name: ${{ matrix.cache-name }}
71+
cache-name: android-${{ matrix.target }}-${{inputs.version}}-${{ matrix.engine }}
8272
continue-on-error: true
8373

8474
- name: Download deps artifact
@@ -111,24 +101,30 @@ jobs:
111101
if: inputs.version == '4.4'
112102
uses: ./.github/actions/godot-build
113103
with:
114-
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
104+
sconsflags: >-
105+
${{ env.SCONSFLAGS }}
106+
${{ matrix.engine == 'qjs-ng' && 'use_quickjs_ng=yes' || '' }}
107+
deprecated=no
108+
ndk_platform=android-24
109+
generate_apk=yes
115110
platform: android
116111
target: ${{ matrix.target }}
117-
tests: ${{ matrix.tests }}
118-
scons-cache-limit: ${{ matrix.cache-limit }}
112+
scons-cache-limit: 1
119113

120114
- name: Compilation [4.5+]
121115
if: inputs.version != '4.4'
122116
uses: ./.github/actions/godot-build
123117
with:
124-
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.sconsflags }}
118+
scons-flags: >-
119+
${{ env.SCONS_FLAGS }}
120+
${{ matrix.engine == 'qjs-ng' && 'use_quickjs_ng=yes' || '' }}
125121
platform: android
126122
target: ${{ matrix.target }}
127123

128124
- name: Save Godot build cache
129125
uses: ./.github/actions/godot-cache-save
130126
with:
131-
cache-name: ${{ matrix.cache-name }}
127+
cache-name: android-${{ matrix.target }}-${{inputs.version}}-${{ matrix.engine }}
132128
continue-on-error: true
133129

134130
- name: Generate Godot templates
@@ -142,5 +138,4 @@ jobs:
142138
- name: Upload artifact
143139
uses: ./.github/actions/upload-artifact
144140
with:
145-
name: ${{ matrix.cache-name }}
146-
141+
name: android-${{ matrix.target }}-${{inputs.version}}-${{ matrix.engine }}

.github/workflows/build_engine_version.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
description: "V8 version"
1515
required: true
1616
type: string
17+
tests:
18+
type: boolean
19+
default: true
1720

1821
jobs:
1922
android-build:
@@ -36,20 +39,23 @@ jobs:
3639
with:
3740
version: ${{ inputs.version }}
3841
version_ref: ${{ inputs.version_ref }}
42+
tests: ${{ inputs.tests }}
3943

4044
macos-build:
4145
name: 🍎 macOS
4246
uses: ./.github/workflows/build_macos.yml
4347
with:
4448
version: ${{ inputs.version }}
4549
version_ref: ${{ inputs.version_ref }}
50+
tests: ${{ inputs.tests }}
4651

4752
windows-build:
4853
name: 🏁 Windows
4954
uses: ./.github/workflows/build_windows.yml
5055
with:
5156
version: ${{ inputs.version }}
5257
version_ref: ${{ inputs.version_ref }}
58+
tests: ${{ inputs.tests }}
5359

5460
web-build:
5561
name: 🌐 Web

.github/workflows/build_ios.yml

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,14 @@ jobs:
3030
ios-template:
3131
runs-on: macos-latest
3232
timeout-minutes: 60
33-
name: Template (target=template_release)
33+
name: iOS (${{ matrix.target }}, ${{ matrix.engine }})
3434
strategy:
3535
fail-fast: false
3636
matrix:
37-
include:
38-
- name: Template (target=template_release, v8)
39-
cache-name: ios-template-release-${{inputs.version}}-v8
40-
target: template_release
41-
cache-limit: 1
42-
43-
- name: Template (target=template_release, qjs_ng)
44-
cache-name: ios-template-release-${{inputs.version}}-qjs-ng
45-
target: template_release
46-
sconsflags: use_quickjs_ng=yes
47-
cache-limit: 1
48-
49-
# - name: Template (target=template_release, jsc)
50-
# cache-name: ios-template-${{inputs.version}}-jsc
51-
# target: template_release
52-
# sconsflags: use_jsc=yes
53-
# cache-limit: 1
37+
# QuickJS & JSC isn't working at the moment
38+
# engine: [ v8, qjs-ng, jsc ]
39+
engine: [ v8 ]
40+
target: [ template_release, template_debug ]
5441

5542
steps:
5643
- name: Checkout Godot
@@ -70,6 +57,8 @@ jobs:
7057
- name: Restore Godot build cache
7158
uses: ./.github/actions/godot-cache-restore
7259
continue-on-error: true
60+
with:
61+
cache-name: ios-${{ matrix.target }}-${{inputs.version}}-${{ matrix.engine }}
7362

7463
- name: Download deps artifact
7564
uses: actions/download-artifact@v4
@@ -90,26 +79,30 @@ jobs:
9079
if: inputs.version == '4.4'
9180
uses: ./.github/actions/godot-build
9281
with:
93-
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
82+
sconsflags: >-
83+
${{ env.SCONSFLAGS }}
84+
${{ matrix.engine == 'qjs-ng' && 'use_quickjs_ng=yes' || '' }}
9485
platform: ios
9586
target: ${{ matrix.target }}
96-
scons-cache-limit: ${{ matrix.cache-limit }}
87+
scons-cache-limit: 1
9788

9889
- name: Compilation [4.5+]
9990
if: inputs.version != '4.4'
10091
uses: ./.github/actions/godot-build
10192
with:
102-
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.sconsflags }}
93+
scons-flags: >-
94+
${{ env.SCONS_FLAGS }}
95+
${{ matrix.engine == 'qjs-ng' && 'use_quickjs_ng=yes' || '' }}
10396
platform: ios
10497
target: ${{ matrix.target }}
10598

10699
- name: Save Godot build cache
107100
uses: ./.github/actions/godot-cache-save
108101
with:
109-
cache-name: ${{ matrix.cache-name }}
102+
cache-name: ios-${{ matrix.target }}-${{inputs.version}}-${{ matrix.engine }}
110103
continue-on-error: true
111104

112105
- name: Upload artifact
113106
uses: ./.github/actions/upload-artifact
114107
with:
115-
name: ${{ matrix.cache-name }}
108+
name: ios-${{ matrix.target }}-${{inputs.version}}-${{ matrix.engine }}

.github/workflows/build_linux.yml

Lines changed: 38 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
description: "Godot engine commit reference"
1010
required: true
1111
type: string
12+
tests:
13+
type: boolean
14+
default: true
1215

1316
# Global Settings
1417
env:
@@ -33,47 +36,15 @@ jobs:
3336
build-linux:
3437
# Stay one LTS before latest to increase portability of Linux artifacts.
3538
runs-on: ubuntu-22.04
36-
name: ${{ matrix.name }}
39+
name: Linux (${{ matrix.target }}, ${{ matrix.engine }})
3740
timeout-minutes: 120
3841
strategy:
3942
fail-fast: false
4043
matrix:
41-
include:
42-
- name: Editor (target=editor, v8)
43-
cache-name: linux-editor-${{inputs.version}}-v8
44-
target: editor
45-
cache-limit: 2
46-
47-
- name: Template release (target=template_release, v8)
48-
cache-name: linux-template-release-${{inputs.version}}-v8
49-
sconsflags: debug_symbols=no
50-
target: template_release
51-
cache-limit: 1
52-
53-
- name: Template debug (target=template_debug, v8)
54-
cache-name: linux-template-debug-${{inputs.version}}-v8
55-
sconsflags: debug_symbols=no
56-
target: template_debug
57-
bin: ./bin/godot.linuxbsd.template_debug.x86_64.v8
58-
cache-limit: 1
59-
60-
- name: Editor (target=editor, qjs_ng)
61-
cache-name: linux-editor-${{inputs.version}}-qjs-ng
62-
target: editor
63-
sconsflags: use_quickjs_ng=yes
64-
cache-limit: 2
65-
66-
- name: Template release (target=template_release, qjs_ng)
67-
cache-name: linux-template-release-${{inputs.version}}-qjs-ng
68-
target: template_release
69-
sconsflags: use_quickjs_ng=yes debug_symbols=no
70-
cache-limit: 1
71-
72-
- name: Template debug (target=template_debug, qjs_ng)
73-
cache-name: linux-template-debug-${{inputs.version}}-qjs-ng
74-
target: template_debug
75-
sconsflags: use_quickjs_ng=yes debug_symbols=no
76-
cache-limit: 1
44+
# QuickJS isn't working at the moment
45+
# engine: [ v8, qjs-ng ]
46+
engine: [v8]
47+
target: [editor, template_release, template_debug]
7748

7849
steps:
7950
- name: Checkout Godot
@@ -104,7 +75,7 @@ jobs:
10475
- name: Restore Godot build cache
10576
uses: ./.github/actions/godot-cache-restore
10677
with:
107-
cache-name: ${{ matrix.cache-name }}
78+
cache-name: linux-${{ matrix.target }}-${{inputs.version}}-${{ matrix.engine }}
10879
continue-on-error: true
10980

11081
- name: Download deps artifact
@@ -119,6 +90,13 @@ jobs:
11990
name: scripts-out
12091
path: ${{github.workspace}}/modules/GodotJS/scripts/out
12192

93+
- name: Download tests/project
94+
if: ${{ inputs.tests && matrix.target == 'editor' }}
95+
uses: actions/download-artifact@v4
96+
with:
97+
name: tests-project
98+
path: ${{github.workspace}}/modules/GodotJS/tests/project/.godot/GodotJS
99+
122100
- name: Setup Python and SCons
123101
uses: ./.github/actions/godot-deps
124102

@@ -139,22 +117,30 @@ jobs:
139117
if: inputs.version == '4.4'
140118
uses: ./.github/actions/godot-build
141119
with:
142-
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
120+
sconsflags: >-
121+
${{ env.SCONSFLAGS }}
122+
${{ matrix.target != 'editor' && 'debug_symbols=no' || '' }}
123+
${{ matrix.engine == 'qjs-ng' && 'use_quickjs_ng=yes' || '' }}
124+
${{ inputs.tests && matrix.target == 'editor' && 'tests=yes' || '' }}
143125
platform: linuxbsd
144126
target: ${{ matrix.target }}
145-
scons-cache-limit: ${{ matrix.cache-limit }}
127+
scons-cache-limit: ${{ matrix.target == 'editor' && 2 || 1 }}
146128

147129
- name: Compilation [4.5+]
148130
if: inputs.version != '4.4'
149131
uses: ./.github/actions/godot-build
150132
with:
151-
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.sconsflags }}
133+
scons-flags: >-
134+
${{ env.SCONS_FLAGS }}
135+
${{ matrix.target != 'editor' && 'debug_symbols=no' || '' }}
136+
${{ matrix.engine == 'qjs-ng' && 'use_quickjs_ng=yes' || '' }}
137+
${{ inputs.tests && matrix.target == 'editor' && 'tests=yes' || '' }}
152138
platform: linuxbsd
153139

154140
- name: Save Godot build cache
155141
uses: ./.github/actions/godot-cache-save
156142
with:
157-
cache-name: ${{ matrix.cache-name }}
143+
cache-name: linux-${{ matrix.target }}-${{inputs.version}}-${{ matrix.engine }}
158144
continue-on-error: true
159145

160146
- name: Prepare artifact
@@ -165,4 +151,13 @@ jobs:
165151
- name: Upload artifact
166152
uses: ./.github/actions/upload-artifact
167153
with:
168-
name: ${{ matrix.cache-name }}
154+
name: linux-${{ matrix.target }}-${{inputs.version}}-${{ matrix.engine }}
155+
156+
- name: Unit tests
157+
if: ${{ inputs.tests && matrix.target == 'editor' }}
158+
env:
159+
BIN: ./bin/godot.linuxbsd.editor.x86_64
160+
run: |
161+
${{ env.BIN }} --version
162+
${{ env.BIN }} --help
163+
${{ env.BIN }} --headless --test --test-case="[jsb]*" --force-colors

0 commit comments

Comments
 (0)