main-dothop-ci #224
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Tests | |
run-name: ${{ github.head_ref || github.ref_name }}-dothop-ci | |
on: [ push ] | |
concurrency: | |
group: dothop-ci${{ github.event.number }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
environment: Godot Dev Env | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Cache Godot files | |
id: cache-godot | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.local/share/godot/** | |
/usr/local/bin/godot | |
~/.config/godot/** | |
key: ${{ runner.os }}-godot-${{ vars.GODOT_VERSION }} | |
- name: Download and config Godot Engine headless linux server | |
if: steps.cache-godot.outputs.cache-hit != 'true' | |
shell: bash | |
run: | | |
wget -q https://downloads.tuxfamily.org/godotengine/${{ vars.GODOT_VERSION }}/Godot_v${{ vars.GODOT_VERSION }}-stable_linux.x86_64.zip | |
mkdir ~/.cache | |
mkdir -p ~/.config/godot | |
unzip Godot_v${{ vars.GODOT_VERSION }}-stable_linux.x86_64.zip | |
mv Godot_v${{ vars.GODOT_VERSION }}-stable_linux.x86_64 /usr/local/bin/godot | |
# https://github.com/MikeSchulze/gdUnit4/blob/master/.github/workflows/ci-pr-example.yml | |
- name: "Update Project" | |
continue-on-error: true | |
shell: bash | |
run: | | |
godot -e --path . -s res://addons/gdUnit4/bin/ProjectScanner.gd --headless --audio-driver Dummy | |
- name: "Run Unit Tests" | |
timeout-minutes: 10 | |
shell: bash | |
run: | | |
chmod +x ./addons/gdUnit4/runtest.sh | |
xvfb-run --auto-servernum ./addons/gdUnit4/runtest.sh --add "res://test" --audio-driver Dummy --display-driver x11 --rendering-driver opengl3 --screen 0 --continue |