Skip to content

Commit

Permalink
Add jvm desktop export tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chippmann committed Aug 21, 2024
1 parent 700d762 commit c072141
Show file tree
Hide file tree
Showing 8 changed files with 1,089 additions and 56 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/test_linux_exports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: 🐧 Linux Exports Tests
on:
workflow_call:
inputs:
godot-version:
type: string
jvm-version:
type: string

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-linux_exports_tests
cancel-in-progress: true

jobs:
test-linux-exports:
runs-on: ubuntu-20.04
name: ${{ matrix.name }}
strategy:
matrix:
include:
- name: dev tests
target: dev
bootstrap-target: debug
- name: release tests
target: release
bootstrap-target: release

steps:
- name: Clone Godot Engine
uses: actions/checkout@v4
with:
repository: godotengine/godot
ref: ${{ inputs.godot-version }}

- name: Clone Godot JVM module.
uses: actions/checkout@v4
with:
path: modules/kotlin_jvm

- uses: actions/setup-java@v4
with:
distribution: adopt-hotspot
java-version: ${{ inputs.jvm-version }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ github.ref != 'refs/heads/master' }}

- name: Download linux editor ${{ matrix.target }}
uses: actions/download-artifact@v4
with:
name: editor_${{ matrix.target }}_linux_x86_64
path: './bin'

- name: Download godot-bootstrap ${{ matrix.bootstrap-target }}
uses: actions/download-artifact@v4
with:
name: jvm_godot-bootstrap_${{ matrix.bootstrap-target }}
path: './bin'

- name: Download linux x86_64 ${{ matrix.bootstrap-target }} export template
uses: actions/download-artifact@v4
with:
name: export_template_${{ matrix.bootstrap-target }}_linux_x86_64
path: "./"

- name: Prepare export
run: |
mkdir -p modules/kotlin_jvm/harness/tests/export
mv godot.linuxbsd.template_${{ matrix.bootstrap-target }}.x86_64 modules/kotlin_jvm/harness/tests/export/godot.linuxbsd.template_${{ matrix.bootstrap-target }}.x86_64
- name: Build tests project
run: |
modules/kotlin_jvm/harness/tests/gradlew -p modules/kotlin_jvm/harness/tests/ build -P${{ matrix.bootstrap-target }}
- name: Create JRE
run: |
jlink --add-modules java.base,java.logging --output jre-amd64-linux
- name: Export tests project
run: |
cd modules/kotlin_jvm/harness/tests/
../../../../editor_${{ matrix.target }}_linux_x86_64 --headless --export-release tests_linux
- name: Run Tests
run: |
cd modules/kotlin_jvm/harness/tests/
./gradlew runExportedGutTests
timeout-minutes: 30
98 changes: 98 additions & 0 deletions .github/workflows/test_macos_exports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: 🍎 MacOS Exports Tests
on:
workflow_call:
inputs:
godot-version:
type: string
jvm-version:
type: string

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-macos_exports_tests
cancel-in-progress: true

jobs:
test-macos-exports:
runs-on: macos-latest
name: ${{ matrix.name }}
strategy:
matrix:
include:
- name: dev tests
target: dev
bootstrap-target: debug
- name: release tests
target: release
bootstrap-target: release

steps:
- name: Clone Godot Engine
uses: actions/checkout@v4
with:
repository: godotengine/godot
ref: ${{ inputs.godot-version }}

- name: Clone Godot JVM module.
uses: actions/checkout@v4
with:
path: modules/kotlin_jvm

- uses: actions/setup-java@v4
with:
distribution: adopt-hotspot
java-version: ${{ inputs.jvm-version }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ github.ref != 'refs/heads/master' }}

- name: Download macos editor ${{ matrix.target }}
uses: actions/download-artifact@v4
with:
name: editor_${{ matrix.target }}_macos_universal
path: './bin'

- name: Download godot-bootstrap ${{ matrix.bootstrap-target }}
uses: actions/download-artifact@v4
with:
name: jvm_godot-bootstrap_${{ matrix.bootstrap-target }}
path: './bin'

- name: Download macos export template
uses: actions/download-artifact@v4
with:
name: export_template_all_macos
path: "./"

- name: Prepare export
run: |
mkdir -p modules/kotlin_jvm/harness/tests/export
mv export_template_all_macos.zip modules/kotlin_jvm/harness/tests/export/export_template_all_macos.zip
- name: Build tests project
run: |
modules/kotlin_jvm/harness/tests/gradlew -p modules/kotlin_jvm/harness/tests/ build -P${{ matrix.bootstrap-target }}
- name: Create JRE
run: |
jlink --add-modules java.base,java.logging --output jre-arm64-macos
mkdir jre-amd64-macos #create a fake jre dir for amd64 so the export is happy. The test will run on arm anyways
- name: Export tests project
run: |
cd modules/kotlin_jvm/harness/tests/
../../../../editor_${{ matrix.target }}_macos_universal --headless --export-release tests_macos
- name: Extract app from dmg
run: |
cd modules/kotlin_jvm/harness/tests/export
hdiutil attach tests.dmg
cp -a /Volumes/tests/Godot\ Kotlin\ Tests.app Godot\ Kotlin\ Tests.app
hdiutil detach /Volumes/tests
- name: Run Tests
run: |
cd modules/kotlin_jvm/harness/tests/
./gradlew runExportedGutTests
timeout-minutes: 30
90 changes: 90 additions & 0 deletions .github/workflows/test_windows_exports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: 🪟 Windows Exports Tests
on:
workflow_call:
inputs:
godot-version:
type: string
jvm-version:
type: string

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-windows_exports_tests
cancel-in-progress: true

jobs:
test-windows-exports:
runs-on: windows-latest
name: ${{ matrix.name }}
strategy:
matrix:
include:
- name: dev tests
target: dev
bootstrap-target: debug
- name: release tests
target: release
bootstrap-target: release

steps:
- name: Clone Godot Engine
uses: actions/checkout@v4
with:
repository: godotengine/godot
ref: ${{ inputs.godot-version }}

- name: Clone Godot JVM module.
uses: actions/checkout@v4
with:
path: modules/kotlin_jvm

- uses: actions/setup-java@v4
with:
distribution: adopt-hotspot
java-version: ${{ inputs.jvm-version }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ github.ref != 'refs/heads/master' }}

- name: Download windows editor ${{ matrix.target }}
uses: actions/download-artifact@v4
with:
name: editor_${{ matrix.target }}_windows_x86_64
path: './bin'

- name: Download godot-bootstrap ${{ matrix.bootstrap-target }}
uses: actions/download-artifact@v4
with:
name: jvm_godot-bootstrap_${{ matrix.bootstrap-target }}
path: './bin'

- name: Download windows x86_64 ${{ matrix.bootstrap-target }} export template
uses: actions/download-artifact@v4
with:
name: export_template_${{ matrix.bootstrap-target }}_windows_x86_64
path: "./"

- name: Prepare export
run: |
mkdir -p modules/kotlin_jvm/harness/tests/export
mv godot.windows.template_${{ matrix.bootstrap-target }}.x86_64 modules/kotlin_jvm/harness/tests/export/godot.windows.template_${{ matrix.bootstrap-target }}.x86_64
- name: Build tests project
run: |
modules/kotlin_jvm/harness/tests/gradlew -p modules/kotlin_jvm/harness/tests/ build -P${{ matrix.bootstrap-target }}
- name: Create JRE
run: |
jlink --add-modules java.base,java.logging --output jre-amd64-windows
- name: Export tests project
run: |
cd modules/kotlin_jvm/harness/tests/
../../../../editor_${{ matrix.target }}_windows_x86_64 --headless --export-release tests_windows
- name: Run Tests
run: |
cd modules/kotlin_jvm/harness/tests/
./gradlew runExportedGutTests
timeout-minutes: 30
11 changes: 11 additions & 0 deletions .github/workflows/trigger_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ jobs:
test-linux:
name: 🐧 Test Linux
uses: ./.github/workflows/test_linux.yml
needs:
- setup-build-variables
- build-jvm
- build-linux
with:
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
jvm-version: ${{ needs.setup-build-variables.outputs['jvm-version'] }}

test-linux-exports:
name: 🐧 Test Linux Exports
uses: ./.github/workflows/test_linux_exports.yml
needs:
- setup-build-variables
- build-jvm
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/trigger_on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,36 @@ jobs:
with:
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
jvm-version: ${{ needs.setup-build-variables.outputs['jvm-version'] }}

test-linux-exports:
name: 🐧 Test Linux Exports
uses: ./.github/workflows/test_linux_exports.yml
needs:
- setup-build-variables
- build-jvm
- build-linux
with:
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
jvm-version: ${{ needs.setup-build-variables.outputs['jvm-version'] }}

test-macos-exports:
name: 🍎 Test Macos
uses: ./.github/workflows/test_macos_exports.yml
needs:
- setup-build-variables
- build-jvm
- assemble-macos # we need the universal binary
with:
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
jvm-version: ${{ needs.setup-build-variables.outputs['jvm-version'] }}

test-windows-exports:
name: 🪟 Test Windows
uses: ./.github/workflows/test_windows_exports.yml
needs:
- setup-build-variables
- build-jvm
- build-windows
with:
godot-version: ${{ needs.setup-build-variables.outputs['godot-version'] }}
jvm-version: ${{ needs.setup-build-variables.outputs['jvm-version'] }}
Loading

0 comments on commit c072141

Please sign in to comment.