Skip to content

Commit

Permalink
GD-57: Running the action on a .NET project not repects the defined g…
Browse files Browse the repository at this point in the history
…dUnit4 api versions (#59)

# Why
When using the action on a .NET project, the project specific defined gdUnit.api and gdUnit4.test.adapter are replaced by the latest available released version and result into conflicts.

# What
Removed the gdunit api package replacement to respect the original defined package dependencies.
  • Loading branch information
MikeSchulze authored Jan 22, 2025
1 parent a2f61c9 commit 50ab18f
Show file tree
Hide file tree
Showing 9 changed files with 258 additions and 161 deletions.
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ body:
description: Which gdUnit4-action version are you using?
options:
- gdUnit4-action@master (Pre Release/Master branch)
- [email protected] (Latest Release)
- [email protected] (Latest Release)
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ concurrency:
jobs:

unit-tests:
runs-on: ${{ matrix.godot-net == 'net7.0' && 'ubuntu-22.04' || 'ubuntu-24.04' }}
runs-on: ${{ matrix.dotnet-version == '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']
dotnet-version: ['', 'net7.0', 'net8.0']
version: ['master', 'latest']

permissions:
Expand All @@ -37,7 +37,7 @@ jobs:
pull-requests: write
statuses: write

name: 'GdUnit4 ${{ matrix.version }} on Godot_${{ matrix.godot-version }} ${{ matrix.godot-net }}'
name: 'GdUnit4 ${{ matrix.version }} on Godot_${{ matrix.godot-version }} ${{ matrix.dotnet-version }}'

steps:
- name: 'Checkout gdUnit4-action'
Expand All @@ -51,7 +51,7 @@ jobs:
mv -f .github/workflows/resources/* .
- name: 'Test gdUnit4-action: GdUnit4 ${{ matrix.version }} - Godot_${{ matrix.godot-version }}'
if: ${{ matrix.godot-net == '' }}
if: ${{ matrix.dotnet-version == '' }}
id: test-action
continue-on-error: true
timeout-minutes: 5
Expand All @@ -77,21 +77,22 @@ jobs:
exit 1
fi
- name: 'Test gdUnit4-action: GdUnit4 ${{ matrix.version }} - Godot_${{ matrix.godot-version }}-${{ matrix.godot-net }}'
if: ${{ matrix.godot-net != '' }}
- name: 'Test gdUnit4-action: GdUnit4 ${{ matrix.version }} - Godot_${{ matrix.godot-version }}-${{ matrix.dotnet-version }}'
if: ${{ matrix.dotnet-version != '' }}
env:
DOTNET_VERSION: ${{ matrix.godot-net }}
DOTNET_VERSION: ${{ matrix.dotnet-version }}
timeout-minutes: 5
uses: ./
with:
godot-version: ${{ matrix.godot-version }}
godot-status: ${{ matrix.godot-status }}
godot-net: true
dotnet-version: ${{ matrix.dotnet-version }}
version: ${{ matrix.version }}
paths: 'res://tests/mono'
timeout: 2
retries: 3 # We have set the number of repetitions to 3 because Godot mono randomly crashes during C# tests
report-name: gdUnit4-${{ matrix.version }}_Godot${{ matrix.godot-version }}${{ matrix.godot-net }}
report-name: gdUnit4-${{ matrix.version }}_Godot${{ matrix.godot-version }}${{ matrix.dotnet-version }}


unit-tests-custom-working-directory:
Expand Down Expand Up @@ -178,6 +179,7 @@ jobs:
with:
godot-version: 4.2.2
godot-force-mono : 'true'
dotnet-version: 'net8.0'
paths: |
res://tests/
timeout: 2
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/ci-pr-publish-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ permissions:

jobs:
publish-reports:
runs-on: ubuntu-22.04
runs-on: ${{ matrix.dotnet-version == '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']
dotnet-version: ['', 'net7.0', 'net8.0']
gdunit-version: ['master', 'latest', 'v4.2.0']

steps:
- uses: actions/checkout@v4
Expand All @@ -36,32 +36,32 @@ jobs:
- name: Download artifacts
uses: actions/[email protected]
with:
name: artifact_gdUnit4_${{ matrix.version }}_Godot${{ matrix.godot-version }}${{ matrix.godot-net }}
name: artifact_gdUnit4_${{ matrix.gdunit-version }}_Godot${{ matrix.godot-version }}${{ matrix.dotnet-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: MikeSchulze/gdUnit4-action
run-id: ${{ github.event.inputs.workflow_run_id || github.event.workflow_run.id }}

- name: 'Publish Test Results'
if: ${{ matrix.godot-net == '' }}
if: ${{ matrix.dotnet-version == '' }}
uses: dorny/[email protected]
with:
name: report_gdUnit4_Godot${{ matrix.godot-version }}
name: report_gdUnit4_${{ matrix.gdunit-version }}-Godot${{ matrix.godot-version }}
# using artifact to download is broken since download-artifact@v4 see https://github.com/dorny/test-reporter/issues/363
# We do the download manually on step `Download artifacts`
#artifact: artifact_gdUnit4_Godot${{ matrix.godot-version }}-${{ matrix.godot-status }}${{ matrix.godot-net }}
#artifact: artifact_gdUnit4_Godot${{ matrix.godot-version }}-${{ matrix.godot-status }}${{ matrix.gdotnet-version }}
path: './home/runner/work/gdUnit4-action/gdUnit4-action/reports/**/results.xml'
reporter: java-junit
fail-on-error: 'false'
fail-on-empty: 'false'

- name: 'Publish Test Adapter Results'
if: ${{ matrix.godot-net != '' }}
if: ${{ matrix.dotnet-version != '' }}
uses: dorny/[email protected]
with:
name: report_gdUnit4_Godot${{ matrix.godot-version }}-${{ matrix.godot-net }}
name: report_gdUnit4_${{ matrix.gdunit-version }}-Godot${{ matrix.godot-version }}-${{ matrix.dotnet-version }}
# using artifact to download is broken since download-artifact@v4 see https://github.com/dorny/test-reporter/issues/363
# We do the download manually on step `Download artifacts`
#artifact: artifact_gdUnit4_Godot${{ matrix.godot-version }}-${{ matrix.godot-status }}${{ matrix.godot-net }}
#artifact: artifact_gdUnit4_Godot${{ matrix.godot-version }}-${{ matrix.godot-status }}${{ matrix.gdotnet-version }}
path: './home/runner/work/gdUnit4-action/gdUnit4-action/reports/*.xml'
reporter: dotnet-trx
fail-on-error: 'false'
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ concurrency:
jobs:

unit-tests:
runs-on: ${{ matrix.godot-net == 'net7.0' && 'ubuntu-22.04' || 'ubuntu-24.04' }}
runs-on: ${{ matrix.dotnet-version == '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']
dotnet-version: ['', 'net7.0', 'net8.0']
version: ['master', 'latest', 'v4.2.0']

permissions:
Expand All @@ -34,7 +34,7 @@ jobs:
checks: write
pull-requests: write
statuses: write
name: 'GdUnit4 ${{ matrix.version }} on Godot_${{ matrix.godot-version }} ${{ matrix.godot-net }}'
name: 'GdUnit4 ${{ matrix.version }} on Godot_${{ matrix.godot-version }} ${{ matrix.dotnet-version }}'

steps:
- name: 'Checkout gdUnit4-action'
Expand All @@ -48,7 +48,7 @@ jobs:
mv -f .github/workflows/resources/* .
- name: 'Test gdUnit4-action: GdUnit4 ${{ matrix.version }} - Godot_${{ matrix.godot-version }}'
if: ${{ matrix.godot-net == '' }}
if: ${{ matrix.dotnet-version == '' }}
id: test-action
continue-on-error: true
timeout-minutes: 5
Expand All @@ -62,7 +62,7 @@ jobs:
res://tests-2/
timeout: 2
publish-report: false
report-name: gdUnit4_${{ matrix.version }}_Godot${{ matrix.godot-version }}${{ matrix.godot-net }}
report-name: gdUnit4_${{ matrix.version }}_Godot${{ matrix.godot-version }}${{ matrix.dotnet-version }}

- name: 'Verify used Godot version if failed'
if: ${{ steps.test-action.outcome == 'failure'}}
Expand All @@ -75,23 +75,24 @@ jobs:
exit 1
fi
- name: 'Test gdUnit4-action: GdUnit4 ${{ matrix.version }} - Godot_${{ matrix.godot-version }}-${{ matrix.godot-net }}'
if: ${{ matrix.godot-net != '' }}
- name: 'Test gdUnit4-action: GdUnit4 ${{ matrix.version }} - Godot_${{ matrix.godot-version }}-${{ matrix.dotnet-version }}'
if: ${{ matrix.dotnet-version != '' }}
env:
DOTNET_VERSION: ${{ matrix.godot-net }}
DOTNET_VERSION: ${{ matrix.dotnet-version }}
timeout-minutes: 5
uses: ./
with:
godot-version: ${{ matrix.godot-version }}
godot-status: ${{ matrix.godot-status }}
godot-net: true
dotnet-version: ${{ matrix.dotnet-version }}
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 }}
report-name: gdUnit4_${{ matrix.version }}_Godot${{ matrix.godot-version }}${{ matrix.dotnet-version }}

unit-tests-custom-working-directory:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -175,6 +176,7 @@ jobs:
with:
godot-version: 4.2.2
godot-force-mono : 'true'
dotnet-version: 'net8.0'
paths: |
res://tests/
timeout: 2
Expand Down
13 changes: 13 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 50ab18f

Please sign in to comment.