|
| 1 | +name: ci-pr |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths-ignore: |
| 6 | + - '**.jpg' |
| 7 | + - '**.png' |
| 8 | + - '**.md' |
| 9 | + pull_request_target: |
| 10 | + paths-ignore: |
| 11 | + - '**.jpg' |
| 12 | + - '**.png' |
| 13 | + - '**.md' |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +env: |
| 17 | + GODOT_BIN: "/usr/local/bin/godot" |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: ci-pr-${{ github.event.number }} |
| 21 | + cancel-in-progress: true |
| 22 | + |
| 23 | +jobs: |
| 24 | + |
| 25 | + unit-test: |
| 26 | + strategy: |
| 27 | + fail-fast: false |
| 28 | + matrix: |
| 29 | + godot-version: [3.4.1, 3.4.2, 3.4.4, mono-3.4.1, mono-3.4.2, mono-3.4.4] |
| 30 | + |
| 31 | + name: "CI Godot ${{ matrix.godot-version }}" |
| 32 | + runs-on: ubuntu-latest |
| 33 | + timeout-minutes: 15 |
| 34 | + continue-on-error: false |
| 35 | + container: |
| 36 | + image: barichello/godot-ci:${{ matrix.godot-version }} |
| 37 | + outputs: |
| 38 | + godot-version: ${{ matrix.godot-version }} |
| 39 | + |
| 40 | + steps: |
| 41 | + - name: "Checkout Repository" |
| 42 | + uses: actions/checkout@v3 |
| 43 | + with: |
| 44 | + lfs: true |
| 45 | + submodules: 'recursive' |
| 46 | + |
| 47 | + - name: "Update Project" |
| 48 | + if: ${{ !cancelled() }} |
| 49 | + timeout-minutes: 1 |
| 50 | + continue-on-error: true # we still ignore the timeout, the script is not quit and we run into a timeout |
| 51 | + run: | |
| 52 | + ${{ env.GODOT_BIN }} -e --path . -s res://addons/gdUnit3/scan_project.gd --no-window |
| 53 | +
|
| 54 | + - name: "Setup .NET" |
| 55 | + if: ${{ startsWith( matrix.godot-version, 'mono') }} # we only setup .Net for mono versions |
| 56 | + uses: actions/setup-dotnet@v1 |
| 57 | + with: |
| 58 | + dotnet-version: 6.0.x |
| 59 | + |
| 60 | + - name: "Compile C#" |
| 61 | + if: ${{ startsWith( matrix.godot-version, 'mono') }} # we only compile .Net for mono versions |
| 62 | + run: | |
| 63 | + dotnet restore gdUnit3.csproj |
| 64 | + mkdir -p .mono/assemblies/Debug |
| 65 | + cp /usr/local/bin/GodotSharp/Api/Release/* .mono/assemblies/Debug |
| 66 | + dotnet build -verbosity:m |
| 67 | +
|
| 68 | + - name: "Run Unit Test" |
| 69 | + if: ${{ !cancelled() }} |
| 70 | + timeout-minutes: 10 |
| 71 | + uses: ./.github/actions/unit-test |
| 72 | + with: |
| 73 | + godot-bin: ${{ env.GODOT_BIN }} |
| 74 | + test-includes: "res://addons/gdUnit3/test/" |
| 75 | + |
| 76 | + - name: "Run Unit Test Examples" |
| 77 | + if: ${{ !cancelled() }} |
| 78 | + timeout-minutes: 1 |
| 79 | + uses: ./.github/actions/unit-test |
| 80 | + with: |
| 81 | + godot-bin: ${{ env.GODOT_BIN }} |
| 82 | + test-includes: "res://gdUnit3-examples" |
| 83 | + |
| 84 | + - name: "Publish Unit Test Reports" |
| 85 | + if: ${{ !cancelled() }} |
| 86 | + uses: ./.github/actions/publish-test-report |
| 87 | + with: |
| 88 | + report-name: ${{ matrix.godot-version }} |
| 89 | + |
| 90 | + - name: "Upload Unit Test Reports" |
| 91 | + if: ${{ !cancelled() }} |
| 92 | + uses: ./.github/actions/upload-test-report |
| 93 | + with: |
| 94 | + report-name: ${{ matrix.godot-version }} |
0 commit comments