Skip to content

Commit

Permalink
Add existing tests to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriSizov committed Nov 11, 2024
1 parent cd21f52 commit ee2a344
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .github/actions/run-godot-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Run Godot tests
description: Run a test project on the target platform.

inputs:
project-path:
default: "./tests"
run-script:
default: "./run.gd"

runs:
using: "composite"
steps:
- name: Run the project script
shell: bash
run: |
godot --headless --path ${{ inputs.project-path }} --script ${{ inputs.run-script }} --verbose
7 changes: 6 additions & 1 deletion .github/workflows/build-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ jobs:
name: Compile and upload Android version
uses: ./.github/workflows/extension-build-android.yml

# Then, use the artifacts to test the example project.
# Then, use the artifacts to do tests.

run-tests-project:
name: Run tests on target platforms
needs: [ build-linux, build-macos, build-windows, build-web, build-android ]
uses: ./.github/workflows/tests-run-project.yml

export-example-project:
name: Export the example project for target platforms
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-release-tagged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,18 @@ jobs:
with:
git-base-ref: ${{ github.ref }}

# Then, use the artifacts to do tests.

run-tests-project:
name: Run tests on target platforms
needs: [ build-linux, build-macos, build-windows, build-web, build-android ]
uses: ./.github/workflows/tests-run-project.yml

# Then, make a draft release for the tag.

release-all:
name: Make a draft GitHub Release for the tag
needs: [ build-linux, build-macos, build-windows, build-web, build-android ]
needs: [ run-tests-project ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/build-release-unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,25 @@ jobs:
with:
git-base-ref: 'main'

# Then, use the artifacts to do tests.

run-tests-project:
name: Run tests on target platforms
needs: [ build-linux, build-macos, build-windows, build-web, build-android ]
uses: ./.github/workflows/tests-run-project.yml

# Then, use the artifacts to prepare the example project and publish the build.

publish-all:
name: Package and publish the extension
needs: [ build-linux, build-macos, build-windows, build-web, build-android ]
needs: [ run-tests-project ]
uses: ./.github/workflows/extension-publish-all.yml
with:
release-version: 'latest-unstable'

export-example-project:
name: Export the example project for target platforms
needs: [ build-linux, build-macos, build-windows, build-web, build-android ]
needs: [ run-tests-project ]
uses: ./.github/workflows/example-export-project.yml
secrets: inherit
with:
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/tests-run-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Run Tests

on:
workflow_call:

# Make sure jobs cannot overlap.
concurrency:
group: test-${{ github.ref }}-project
cancel-in-progress: true

env:
GODOT_VERSION: "4.3.0-stable"

jobs:
export-publish:
strategy:
fail-fast: false
matrix:
include:
- platform: linux
arch: x86_64
preset: "Linux - x86_64"
runs-on: ubuntu-latest

name: Run the tests project (${{ matrix.preset }})
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4

# Set up prerequisites.

- name: Install Godot ${{ env.GODOT_VERSION }}
uses: chickensoft-games/setup-godot@v2
with:
version: ${{ env.GODOT_VERSION }}
use-dotnet: false
include-templates: true

- name: Verify Godot
shell: bash
run: |
godot --version
- name: Download GDSiON artifacts
uses: actions/download-artifact@v4
with:
path: tests/bin
pattern: libgdsion-*
merge-multiple: true

# Run the tests.

- name: Run tests
uses: ./.github/actions/run-godot-tests

0 comments on commit ee2a344

Please sign in to comment.