master-ci-pr #326
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: ci-pr | |
run-name: ${{ github.head_ref || github.ref_name }}-ci-pr | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.jpg' | |
- '**.png' | |
- '**.md' | |
workflow_dispatch: | |
concurrency: | |
group: ci-pr-${{ github.event.number }} | |
cancel-in-progress: true | |
jobs: | |
unit-tests: | |
runs-on: ${{ matrix.godot-net == 'net7.0' && 'ubuntu-22.04' || 'ubuntu-24.04' }} | |
strategy: | |
fail-fast: false | |
max-parallel: 10 | |
matrix: | |
godot-version: ['4.2', '4.2.1', '4.2.2', '4.3'] | |
godot-status: ['stable'] | |
godot-net: ['', 'net7.0', 'net8.0'] | |
version: ['master', 'latest', 'v4.2.0'] | |
permissions: | |
actions: read | |
contents: read | |
checks: write | |
pull-requests: write | |
statuses: write | |
name: 'GdUnit4 ${{ matrix.version }} on Godot_${{ matrix.godot-version }} ${{ matrix.godot-net }}' | |
steps: | |
- name: 'Checkout gdUnit4-action' | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: 'Install test project' | |
shell: bash | |
run: | | |
mv -f .github/workflows/resources/* . | |
- name: 'Test gdUnit4-action: GdUnit4 ${{ matrix.version }} - Godot_${{ matrix.godot-version }}' | |
if: ${{ matrix.godot-net == '' }} | |
timeout-minutes: 5 | |
uses: ./ | |
with: | |
godot-version: ${{ matrix.godot-version }} | |
godot-status: ${{ matrix.godot-status }} | |
version: ${{ matrix.version }} | |
paths: | | |
res://tests/ | |
res://tests-2/ | |
timeout: 2 | |
publish-report: false | |
report-name: gdUnit4_${{ matrix.version }}_Godot${{ matrix.godot-version }}${{ matrix.godot-net }} | |
- name: 'Test gdUnit4-action: GdUnit4 ${{ matrix.version }} - Godot_${{ matrix.godot-version }}-${{ matrix.godot-net }}' | |
if: ${{ matrix.godot-net != '' }} | |
env: | |
DOTNET_VERSION: ${{ matrix.godot-net }} | |
timeout-minutes: 5 | |
uses: ./ | |
with: | |
godot-version: ${{ matrix.godot-version }} | |
godot-status: ${{ matrix.godot-status }} | |
godot-net: true | |
version: ${{ matrix.version }} | |
paths: 'res://tests/mono' | |
timeout: 2 | |
retries: 3 # We have set the number of repetitions to 3 because Godot .Net randomly crashes during C# tests | |
publish-report: false | |
report-name: gdUnit4_${{ matrix.version }}_Godot${{ matrix.godot-version }}${{ matrix.godot-net }} | |
unit-tests-custom-working-directory: | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
permissions: | |
actions: read | |
contents: read | |
checks: write | |
pull-requests: write | |
statuses: write | |
name: 'GdUnit4 action on custom working directory' | |
steps: | |
- name: 'Checkout gdUnit4-action' | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: 'Install custom test project' | |
shell: bash | |
run: | | |
mv -f .github/workflows/custom_workpath/ ./custom_workpath/ | |
- name: 'Test gdUnit4-action: on custom project directory' | |
timeout-minutes: 5 | |
uses: ./ | |
with: | |
godot-version: 4.2.2 | |
project_dir: './custom_workpath/' | |
paths: | | |
res://tests/ | |
timeout: 2 | |
publish-report: false | |
report-name: gdUnit4-custom-working-directory | |
- name: 'Test gdUnit4-action: on custom project directory C#' | |
timeout-minutes: 5 | |
uses: ./ | |
with: | |
godot-version: 4.2.2 | |
godot-net: true | |
version: 'installed' | |
project_dir: './custom_workpath/' | |
paths: 'res://tests/' | |
timeout: 2 | |
publish-report: false | |
report-name: gdUnit4-custom-working-directory-net | |
# run gdscript tests with using Godot Net executable | |
unit-tests-force-godot-mono: | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
permissions: | |
actions: read | |
contents: read | |
checks: write | |
pull-requests: write | |
statuses: write | |
name: 'GdUnit4 action with force run Godot net8.0' | |
steps: | |
- name: 'Checkout gdUnit4-action' | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: 'Install custom test project' | |
shell: bash | |
run: | | |
mv -f .github/workflows/resources/* . | |
- name: 'Test gdUnit4-action: force run Godot net8.0' | |
env: | |
DOTNET_VERSION: 'net8.0' | |
id: test-force-mono | |
timeout-minutes: 5 | |
uses: ./ | |
with: | |
godot-version: 4.2.2 | |
godot-force-mono : 'true' | |
paths: | | |
res://tests/ | |
timeout: 2 | |
report-name: gdUnit4-force-mono | |
# tests if the action reports test failures the action must fail | |
action-fail-test: | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
permissions: | |
actions: read | |
contents: read | |
checks: write | |
pull-requests: write | |
statuses: write | |
name: 'GdUnit4 action fail test' | |
steps: | |
- name: 'Checkout gdUnit4-action' | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: 'Install test project' | |
shell: bash | |
run: | | |
mv -f .github/workflows/resources/* . | |
- name: 'Run failing failing test' | |
id: test-fails | |
continue-on-error: true | |
timeout-minutes: 3 | |
env: | |
GDUNIT_FAIL: 'true' | |
uses: ./ | |
with: | |
godot-version: 4.2.2 | |
paths: | | |
res://tests/ | |
timeout: 2 | |
publish-report: false | |
report-name: action_fail_gdUnit4 | |
- if: ${{ steps.test-fails.outcome != 'failure' }} | |
shell: bash | |
run: | | |
echo "The step 'steps.test-fails' must fail but is ${{ steps.test-fails.outcome}}" | |
exit 1 | |
# tests do not build the report | |
test-disable-report: | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
permissions: | |
actions: read | |
contents: read | |
name: 'GdUnit4 action without report generation' | |
steps: | |
- name: 'Checkout gdUnit4-action' | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: 'Install test project' | |
shell: bash | |
run: | | |
mv -f .github/workflows/resources/* . | |
- name: 'Run failing failing test' | |
timeout-minutes: 3 | |
uses: ./ | |
with: | |
godot-version: 4.2.2 | |
paths: | | |
res://tests/ | |
publish-report: false | |
report-name: action_create-report_false | |
finalize: | |
if: ${{ !cancelled() }} | |
runs-on: ubuntu-latest | |
name: 'Final Results' | |
needs: [unit-tests, unit-tests-custom-working-directory, unit-tests-force-godot-mono, action-fail-test] | |
steps: | |
- run: exit 1 | |
if: >- | |
${{ | |
contains(needs.*.result, 'failure') | |
|| contains(needs.*.result, 'cancelled') | |
}} |