|
13 | 13 | - 'examples/audience/ProjectSettings/**' |
14 | 14 | - '.github/workflows/test-audience-sample-app.yml' |
15 | 15 | workflow_dispatch: |
16 | | - inputs: |
17 | | - selfhosted_only: |
18 | | - description: Run only the self-hosted Linux PlayMode validation (skip Win, macOS, GameCI Linux, mobile) |
19 | | - type: boolean |
20 | | - default: false |
21 | 16 |
|
22 | 17 | concurrency: |
23 | 18 | group: ${{ github.workflow }}-${{ github.ref }} |
24 | 19 | cancel-in-progress: true |
25 | 20 |
|
26 | 21 | jobs: |
27 | 22 | playmode: |
28 | | - if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event_name == 'workflow_dispatch' && github.event.inputs.selfhosted_only != 'true') |
| 23 | + if: github.event.pull_request.head.repo.fork == false || github.event_name == 'workflow_dispatch' |
29 | 24 | name: ${{ matrix.target }} / ${{ matrix.backend }} / Unity ${{ matrix.unity }} |
30 | 25 | strategy: |
31 | 26 | fail-fast: false |
@@ -445,7 +440,7 @@ jobs: |
445 | 440 | # Linux PlayMode runs on GitHub-hosted Ubuntu via GameCI Docker, not on the |
446 | 441 | # self-hosted matrix above, to keep self-hosted machines free for Win/macOS. |
447 | 442 | playmode-linux: |
448 | | - if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event_name == 'workflow_dispatch' && github.event.inputs.selfhosted_only != 'true') |
| 443 | + if: github.event.pull_request.head.repo.fork == false || github.event_name == 'workflow_dispatch' |
449 | 444 | name: ${{ matrix.target }} / ${{ matrix.backend }} / Unity ${{ matrix.unity }} |
450 | 445 | runs-on: ubuntu-latest-8-cores |
451 | 446 | strategy: |
@@ -509,7 +504,7 @@ jobs: |
509 | 504 | # Note: Unity 6 cells use 6000.4.5f1 (the latest patch with a GameCI image); |
510 | 505 | # 6000.4.0f1 does not have a published GameCI Docker image. |
511 | 506 | mobile-build: |
512 | | - if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event_name == 'workflow_dispatch' && github.event.inputs.selfhosted_only != 'true') |
| 507 | + if: github.event.pull_request.head.repo.fork == false || github.event_name == 'workflow_dispatch' |
513 | 508 | name: ${{ matrix.target }} / IL2CPP / Unity ${{ matrix.unity }} |
514 | 509 | runs-on: ubuntu-latest-8-cores |
515 | 510 | strategy: |
@@ -567,76 +562,3 @@ jobs: |
567 | 562 | path: | |
568 | 563 | examples/audience/Builds/Android/*.apk |
569 | 564 | examples/audience/Logs/** |
570 | | -
|
571 | | - # workflow_dispatch only. Cross-checks the GameCI Docker outcome against |
572 | | - # the self-hosted Linux machine when there's reason to suspect divergence. |
573 | | - playmode-linux-selfhosted: |
574 | | - if: github.event_name == 'workflow_dispatch' |
575 | | - name: ${{ matrix.backend }} / Unity ${{ matrix.unity }} (self-hosted Linux) |
576 | | - runs-on: [self-hosted, X64, Linux] |
577 | | - timeout-minutes: 60 |
578 | | - strategy: |
579 | | - fail-fast: false |
580 | | - matrix: |
581 | | - include: |
582 | | - - backend: IL2CPP |
583 | | - unity: 2021.3.45f2 |
584 | | - - backend: Mono2x |
585 | | - unity: 2021.3.45f2 |
586 | | - |
587 | | - steps: |
588 | | - - uses: actions/checkout@v4 |
589 | | - with: |
590 | | - lfs: true |
591 | | - |
592 | | - - uses: actions/cache@v4 |
593 | | - with: |
594 | | - path: examples/audience/Library |
595 | | - key: Library-selfhosted-${{ matrix.backend }}-StandaloneLinux64-${{ matrix.unity }}-${{ hashFiles('examples/audience/Assets/**', 'examples/audience/Packages/**', 'examples/audience/ProjectSettings/**', 'src/Packages/Audience/**') }} |
596 | | - restore-keys: | |
597 | | - Library-selfhosted-${{ matrix.backend }}-StandaloneLinux64-${{ matrix.unity }}- |
598 | | - Library-selfhosted-${{ matrix.backend }}-StandaloneLinux64- |
599 | | -
|
600 | | - - name: Resolve Unity |
601 | | - shell: bash |
602 | | - run: | |
603 | | - set -uo pipefail |
604 | | - UNITY="$HOME/Unity/Hub/Editor/${{ matrix.unity }}/Editor/Unity" |
605 | | - if [ ! -x "$UNITY" ]; then |
606 | | - echo "::error::Unity ${{ matrix.unity }} not found at $UNITY. Install via Unity Hub on the runner host." |
607 | | - exit 1 |
608 | | - fi |
609 | | - echo "UNITY_PATH=$UNITY" >> "$GITHUB_ENV" |
610 | | -
|
611 | | - - name: Run PlayMode tests |
612 | | - shell: bash |
613 | | - env: |
614 | | - AUDIENCE_TEST_PUBLISHABLE_KEY: ${{ secrets.AUDIENCE_TEST_PUBLISHABLE_KEY }} |
615 | | - AUDIENCE_SCRIPTING_BACKEND: ${{ matrix.backend }} |
616 | | - run: | |
617 | | - set -euo pipefail |
618 | | - mkdir -p artifacts |
619 | | - "$UNITY_PATH" \ |
620 | | - -batchmode -nographics \ |
621 | | - -projectPath examples/audience \ |
622 | | - -runTests \ |
623 | | - -testPlatform StandaloneLinux64 \ |
624 | | - -testResults "$(pwd)/artifacts/test-results.xml" \ |
625 | | - -logFile - 2>&1 | tee "$(pwd)/artifacts/unity.log" |
626 | | -
|
627 | | - - name: Publish test report |
628 | | - uses: dorny/test-reporter@v3 |
629 | | - if: always() |
630 | | - with: |
631 | | - name: Self-hosted Linux PlayMode (${{ matrix.backend }}) |
632 | | - path: artifacts/test-results.xml |
633 | | - reporter: dotnet-nunit |
634 | | - fail-on-error: true |
635 | | - |
636 | | - - uses: actions/upload-artifact@v4 |
637 | | - if: always() |
638 | | - with: |
639 | | - name: selfhosted-linux-${{ matrix.backend }} |
640 | | - path: | |
641 | | - artifacts/test-results.xml |
642 | | - artifacts/unity.log |
0 commit comments