Skip to content

Commit f6936b3

Browse files
authored
Add tests on exported projects to our CI/CD pipeline (#679)
* Add jvm desktop export tests * Fix the editor executable path * Log dir content * Fix editor executable path * Export using gradle instead of scripts * Fix executable resolving * Delay binary resolve * Disable export test task if there is no executable * Fix commandline * Improve editor executable selection * Export as separate step * Add execution permission * Fix nullable case * Fix export template file paths * Fix working dir * tmp rint * Export correct target * Fix property * Remove depends * Fix test executables resolving * Export scripts as text * Use exported project only * Fix paths * Revert "Use exported project only" This reverts commit b5de9f8. * Remove file filter as .app is a dir not a file * Update test names * Escape executable path * Don't clone godot for export tests * Fix editor executable reference * Update editor executable find * Add root project dir to executable resolve * Fix editor download path * Fix setting execution flag
1 parent 7459933 commit f6936b3

File tree

7 files changed

+1151
-62
lines changed

7 files changed

+1151
-62
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: 🐧 Linux Exports Tests
2+
on:
3+
workflow_call:
4+
inputs:
5+
godot-version:
6+
type: string
7+
jvm-version:
8+
type: string
9+
10+
concurrency:
11+
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-linux_exports_tests
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test-linux-exports:
16+
runs-on: ubuntu-20.04
17+
name: ${{ matrix.name }}
18+
strategy:
19+
matrix:
20+
include:
21+
- name: dev tests
22+
target: dev
23+
bootstrap-target: debug
24+
- name: release tests
25+
target: release
26+
bootstrap-target: release
27+
28+
steps:
29+
- name: Clone Godot JVM module.
30+
uses: actions/checkout@v4
31+
32+
- uses: actions/setup-java@v4
33+
with:
34+
distribution: adopt-hotspot
35+
java-version: ${{ inputs.jvm-version }}
36+
37+
- name: Setup Gradle
38+
uses: gradle/actions/setup-gradle@v3
39+
with:
40+
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
41+
42+
- name: Download linux editor ${{ matrix.target }}
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: editor_${{ matrix.target }}_linux_x86_64
46+
path: './harness/tests/bin'
47+
48+
- name: Download godot-bootstrap ${{ matrix.bootstrap-target }}
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: jvm_godot-bootstrap_${{ matrix.bootstrap-target }}
52+
path: './harness/tests/bin'
53+
54+
- name: Download linux x86_64 ${{ matrix.bootstrap-target }} export template
55+
uses: actions/download-artifact@v4
56+
with:
57+
name: export_template_${{ matrix.bootstrap-target }}_linux_x86_64
58+
path: "./"
59+
60+
- name: Prepare export
61+
run: |
62+
chmod +x harness/tests/bin/godot.*
63+
mkdir -p harness/tests/export
64+
mv godot.linuxbsd.template_${{ matrix.bootstrap-target }}.x86_64 harness/tests/godot.linuxbsd.template_${{ matrix.bootstrap-target }}.x86_64
65+
66+
- name: Build tests project
67+
run: |
68+
harness/tests/gradlew -p harness/tests/ build -P${{ matrix.bootstrap-target }}
69+
70+
- name: Create JRE
71+
run: |
72+
cd harness/tests/
73+
jlink --add-modules java.base,java.logging --output jre-amd64-linux
74+
75+
- name: Export tests debug
76+
if: ${{ matrix.bootstrap-target == 'debug' }}
77+
run: |
78+
cd harness/tests/
79+
./gradlew exportDebug
80+
timeout-minutes: 30
81+
82+
- name: Export tests release
83+
if: ${{ matrix.bootstrap-target == 'release' }}
84+
run: |
85+
cd harness/tests/
86+
./gradlew exportRelease
87+
timeout-minutes: 30
88+
89+
- name: Run Tests
90+
run: |
91+
cd harness/tests/
92+
./gradlew runExportedGutTests
93+
timeout-minutes: 30
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: 🍎 MacOS Exports Tests
2+
on:
3+
workflow_call:
4+
inputs:
5+
godot-version:
6+
type: string
7+
jvm-version:
8+
type: string
9+
10+
concurrency:
11+
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-macos_exports_tests
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test-macos-exports:
16+
runs-on: macos-latest
17+
name: ${{ matrix.name }}
18+
strategy:
19+
matrix:
20+
include:
21+
- name: dev tests
22+
target: dev
23+
bootstrap-target: debug
24+
- name: release tests
25+
target: release
26+
bootstrap-target: release
27+
28+
steps:
29+
- name: Clone Godot JVM module.
30+
uses: actions/checkout@v4
31+
32+
- uses: actions/setup-java@v4
33+
with:
34+
distribution: adopt-hotspot
35+
java-version: ${{ inputs.jvm-version }}
36+
37+
- name: Setup Gradle
38+
uses: gradle/actions/setup-gradle@v3
39+
with:
40+
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
41+
42+
- name: Download macos editor ${{ matrix.target }}
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: editor_${{ matrix.target }}_macos_universal
46+
path: './harness/tests/bin'
47+
48+
- name: Download godot-bootstrap ${{ matrix.bootstrap-target }}
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: jvm_godot-bootstrap_${{ matrix.bootstrap-target }}
52+
path: './harness/tests/bin'
53+
54+
- name: Download macos export template
55+
uses: actions/download-artifact@v4
56+
with:
57+
name: export_template_all_macos
58+
path: "./"
59+
60+
- name: Prepare export
61+
run: |
62+
chmod +x harness/tests/bin/godot.*
63+
mkdir -p harness/tests/export
64+
mv export_template_all_macos.zip harness/tests/export_template_all_macos.zip
65+
66+
- name: Build tests project
67+
run: |
68+
harness/tests/gradlew -p harness/tests/ build -P${{ matrix.bootstrap-target }}
69+
70+
- name: Create JRE
71+
run: |
72+
cd harness/tests/
73+
jlink --add-modules java.base,java.logging --output jre-arm64-macos
74+
mkdir jre-amd64-macos #create a fake jre dir for amd64 so the export is happy. The test will run on arm anyways
75+
76+
- name: Export tests debug
77+
if: ${{ matrix.bootstrap-target == 'debug' }}
78+
run: |
79+
cd harness/tests/
80+
./gradlew exportDebug
81+
timeout-minutes: 30
82+
83+
- name: Export tests release
84+
if: ${{ matrix.bootstrap-target == 'release' }}
85+
run: |
86+
cd harness/tests/
87+
./gradlew exportRelease
88+
timeout-minutes: 30
89+
90+
- name: Extract app from dmg
91+
run: |
92+
cd harness/tests/export
93+
hdiutil attach tests.dmg
94+
cp -a /Volumes/Godot\ Kotlin\ Tests/Godot\ Kotlin\ Tests.app Godot\ Kotlin\ Tests.app
95+
hdiutil detach /Volumes/Godot\ Kotlin\ Tests
96+
97+
- name: Run Tests
98+
run: |
99+
cd harness/tests/
100+
./gradlew runExportedGutTests
101+
timeout-minutes: 30
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: 🪟 Windows Exports Tests
2+
on:
3+
workflow_call:
4+
inputs:
5+
godot-version:
6+
type: string
7+
jvm-version:
8+
type: string
9+
10+
concurrency:
11+
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-windows_exports_tests
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test-windows-exports:
16+
runs-on: windows-latest
17+
name: ${{ matrix.name }}
18+
strategy:
19+
matrix:
20+
include:
21+
- name: dev tests
22+
target: dev
23+
bootstrap-target: debug
24+
- name: release tests
25+
target: release
26+
bootstrap-target: release
27+
28+
steps:
29+
- name: Clone Godot JVM module.
30+
uses: actions/checkout@v4
31+
32+
- uses: actions/setup-java@v4
33+
with:
34+
distribution: adopt-hotspot
35+
java-version: ${{ inputs.jvm-version }}
36+
37+
- name: Setup Gradle
38+
uses: gradle/actions/setup-gradle@v3
39+
with:
40+
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
41+
42+
- name: Download windows editor ${{ matrix.target }}
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: editor_${{ matrix.target }}_windows_x86_64
46+
path: './harness/tests/bin'
47+
48+
- name: Download godot-bootstrap ${{ matrix.bootstrap-target }}
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: jvm_godot-bootstrap_${{ matrix.bootstrap-target }}
52+
path: './harness/tests/bin'
53+
54+
- name: Download windows x86_64 ${{ matrix.bootstrap-target }} export template
55+
uses: actions/download-artifact@v4
56+
with:
57+
name: export_template_${{ matrix.bootstrap-target }}_windows_x86_64
58+
path: "./"
59+
60+
- name: Prepare export
61+
run: |
62+
mkdir -p harness/tests/export
63+
mv godot.windows.template_${{ matrix.bootstrap-target }}.x86_64.exe harness/tests/godot.windows.template_${{ matrix.bootstrap-target }}.x86_64.exe
64+
65+
- name: Build tests project
66+
run: |
67+
harness/tests/gradlew -p harness/tests/ build -P${{ matrix.bootstrap-target }}
68+
69+
- name: Create JRE
70+
run: |
71+
cd harness/tests/
72+
jlink --add-modules java.base,java.logging --output jre-amd64-windows
73+
74+
- name: Export tests debug
75+
if: ${{ matrix.bootstrap-target == 'debug' }}
76+
run: |
77+
cd harness/tests/
78+
./gradlew exportDebug
79+
timeout-minutes: 30
80+
81+
- name: Export tests release
82+
if: ${{ matrix.bootstrap-target == 'release' }}
83+
run: |
84+
cd harness/tests/
85+
./gradlew exportRelease
86+
timeout-minutes: 30
87+
88+
- name: Run Tests
89+
run: |
90+
cd harness/tests/
91+
./gradlew runExportedGutTests
92+
timeout-minutes: 30

.github/workflows/trigger_dev.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@ jobs:
8989
test-linux:
9090
name: 🐧 Test Linux
9191
uses: ./.github/workflows/test_linux.yml
92+
needs:
93+
- setup-build-variables
94+
- build-jvm
95+
- build-linux
96+
with:
97+
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
98+
jvm-version: ${{ needs.setup-build-variables.outputs['jvm-version'] }}
99+
100+
test-linux-exports:
101+
name: 🐧 Test Linux Exports
102+
uses: ./.github/workflows/test_linux_exports.yml
92103
needs:
93104
- setup-build-variables
94105
- build-jvm

.github/workflows/trigger_on_pull_request.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,36 @@ jobs:
157157
with:
158158
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
159159
jvm-version: ${{ needs.setup-build-variables.outputs['jvm-version'] }}
160+
161+
test-linux-exports:
162+
name: 🐧 Test Linux Exports
163+
uses: ./.github/workflows/test_linux_exports.yml
164+
needs:
165+
- setup-build-variables
166+
- build-jvm
167+
- build-linux
168+
with:
169+
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
170+
jvm-version: ${{ needs.setup-build-variables.outputs['jvm-version'] }}
171+
172+
test-macos-exports:
173+
name: 🍎 Test Macos Exports
174+
uses: ./.github/workflows/test_macos_exports.yml
175+
needs:
176+
- setup-build-variables
177+
- build-jvm
178+
- assemble-macos # we need the universal binary
179+
with:
180+
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
181+
jvm-version: ${{ needs.setup-build-variables.outputs['jvm-version'] }}
182+
183+
test-windows-exports:
184+
name: 🪟 Test Windows Exports
185+
uses: ./.github/workflows/test_windows_exports.yml
186+
needs:
187+
- setup-build-variables
188+
- build-jvm
189+
- build-windows
190+
with:
191+
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
192+
jvm-version: ${{ needs.setup-build-variables.outputs['jvm-version'] }}

0 commit comments

Comments
 (0)