diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3a625f43..eccbfa8ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,8 @@ on: env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_NOLOGO: 1 + PR_UNITY_VERSIONS: '["2022.3", "6000.0", "6000.3"]' + FULL_UNITY_VERSIONS: '["2021.3", "2022.3", "6000.0", "6000.3"]' defaults: run: @@ -27,11 +29,6 @@ jobs: with: access_token: ${{ github.token }} - create-unity-matrix: - uses: ./.github/workflows/create-unity-matrix.yml - with: - event-name: ${{ github.event_name }} - sdk: strategy: matrix: @@ -89,11 +86,11 @@ jobs: test-create: name: Create ${{ matrix.unity-version }} Test Project if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} - needs: [create-unity-matrix] secrets: inherit strategy: fail-fast: false - matrix: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix) }} + matrix: + unity-version: ${{ github.event_name == 'pull_request' && fromJSON(env.PR_UNITY_VERSIONS) || fromJSON(env.FULL_UNITY_VERSIONS) }} uses: ./.github/workflows/test-create.yml with: unity-version: ${{ matrix.unity-version }} @@ -102,12 +99,12 @@ jobs: test-build-webgl: name: Build ${{ matrix.platform }} ${{ matrix.unity-version }} Test if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} - needs: [test-create, create-unity-matrix] + needs: [test-create] runs-on: ubuntu-latest strategy: fail-fast: false matrix: - unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} + unity-version: ${{ github.event_name == 'pull_request' && fromJSON(env.PR_UNITY_VERSIONS) || fromJSON(env.FULL_UNITY_VERSIONS) }} platform: ["WebGL"] include: - platform: WebGL @@ -242,11 +239,12 @@ jobs: test-build-android: name: Build Android ${{ matrix.unity-version }} Test if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} - needs: [test-create, create-unity-matrix] + needs: [test-create] secrets: inherit strategy: fail-fast: false - matrix: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix) }} + matrix: + unity-version: ${{ github.event_name == 'pull_request' && fromJSON(env.PR_UNITY_VERSIONS) || fromJSON(env.FULL_UNITY_VERSIONS) }} uses: ./.github/workflows/test-build-android.yml with: unity-version: ${{ matrix.unity-version }} @@ -254,7 +252,7 @@ jobs: test-run-android: name: Run Android ${{ matrix.unity-version }} Integration Test if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} - needs: [test-build-android, create-unity-matrix] + needs: [test-build-android] secrets: inherit uses: ./.github/workflows/test-run-android.yml with: @@ -264,7 +262,7 @@ jobs: strategy: fail-fast: false matrix: - unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} + unity-version: ${{ github.event_name == 'pull_request' && fromJSON(env.PR_UNITY_VERSIONS) || fromJSON(env.FULL_UNITY_VERSIONS) }} # api-level: [30, 31, 34] api-level: [30] init-type: ["runtime", "buildtime"] @@ -272,11 +270,12 @@ jobs: test-build-ios: name: Build iOS ${{ matrix.unity-version }} Test if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} - needs: [test-create, create-unity-matrix] + needs: [test-create] secrets: inherit strategy: fail-fast: false - matrix: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix) }} + matrix: + unity-version: ${{ github.event_name == 'pull_request' && fromJSON(env.PR_UNITY_VERSIONS) || fromJSON(env.FULL_UNITY_VERSIONS) }} uses: ./.github/workflows/test-build-ios.yml with: unity-version: ${{ matrix.unity-version }} @@ -284,12 +283,12 @@ jobs: test-compile-ios: name: Compile iOS ${{ matrix.unity-version }} Test if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} - needs: [test-build-ios, create-unity-matrix] + needs: [test-build-ios] secrets: inherit strategy: fail-fast: false matrix: - unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} + unity-version: ${{ github.event_name == 'pull_request' && fromJSON(env.PR_UNITY_VERSIONS) || fromJSON(env.FULL_UNITY_VERSIONS) }} init-type: ["runtime", "buildtime"] uses: ./.github/workflows/test-compile-ios.yml with: @@ -299,7 +298,7 @@ jobs: test-run-ios: name: Run iOS ${{ matrix.unity-version }} Integration Test if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} - needs: [test-compile-ios, create-unity-matrix] + needs: [test-compile-ios] uses: ./.github/workflows/test-run-ios.yml with: unity-version: ${{ matrix.unity-version }} @@ -309,7 +308,7 @@ jobs: strategy: fail-fast: false matrix: - unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} + unity-version: ${{ github.event_name == 'pull_request' && fromJSON(env.PR_UNITY_VERSIONS) || fromJSON(env.FULL_UNITY_VERSIONS) }} ios-version: ["17.0", "latest"] init-type: ["runtime", "buildtime"] # Check https://support.apple.com/en-us/HT201222 for the latest minor version for a given major one. @@ -325,12 +324,12 @@ jobs: test-run-webgl: name: Run WebGL ${{ matrix.unity-version }} Integration Test if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} - needs: [test-build-webgl, create-unity-matrix] + needs: [test-build-webgl] secrets: inherit strategy: fail-fast: false matrix: - unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} + unity-version: ${{ github.event_name == 'pull_request' && fromJSON(env.PR_UNITY_VERSIONS) || fromJSON(env.FULL_UNITY_VERSIONS) }} uses: ./.github/workflows/test-run-webgl.yml with: unity-version: ${{ matrix.unity-version }} @@ -338,12 +337,12 @@ jobs: test-build-linux: name: Build Linux ${{ matrix.unity-version }} Integration Test if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} - needs: [test-create, create-unity-matrix] + needs: [test-create] secrets: inherit strategy: fail-fast: false matrix: - unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} + unity-version: ${{ github.event_name == 'pull_request' && fromJSON(env.PR_UNITY_VERSIONS) || fromJSON(env.FULL_UNITY_VERSIONS) }} uses: ./.github/workflows/test-build-linux.yml with: unity-version: ${{ matrix.unity-version }} @@ -351,12 +350,12 @@ jobs: test-build-windows: name: Build Windows ${{ matrix.unity-version }} Integration Test if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} - needs: [test-create, create-unity-matrix] + needs: [test-create] secrets: inherit strategy: fail-fast: false matrix: - unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} + unity-version: ${{ github.event_name == 'pull_request' && fromJSON(env.PR_UNITY_VERSIONS) || fromJSON(env.FULL_UNITY_VERSIONS) }} uses: ./.github/workflows/test-build-windows.yml with: unity-version: ${{ matrix.unity-version }} @@ -364,12 +363,12 @@ jobs: test-run-linux: name: Run Linux ${{ matrix.unity-version }} Integration Test if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} - needs: [test-build-linux, create-unity-matrix] + needs: [test-build-linux] secrets: inherit strategy: fail-fast: false matrix: - unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} + unity-version: ${{ github.event_name == 'pull_request' && fromJSON(env.PR_UNITY_VERSIONS) || fromJSON(env.FULL_UNITY_VERSIONS) }} uses: ./.github/workflows/test-run-desktop.yml with: unity-version: ${{ matrix.unity-version }} @@ -378,12 +377,12 @@ jobs: test-run-windows: name: Run Windows ${{ matrix.unity-version }} Integration Test if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} - needs: [test-build-windows, create-unity-matrix] + needs: [test-build-windows] secrets: inherit strategy: fail-fast: false matrix: - unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} + unity-version: ${{ github.event_name == 'pull_request' && fromJSON(env.PR_UNITY_VERSIONS) || fromJSON(env.FULL_UNITY_VERSIONS) }} uses: ./.github/workflows/test-run-desktop.yml with: unity-version: ${{ matrix.unity-version }} diff --git a/.github/workflows/create-unity-matrix.yml b/.github/workflows/create-unity-matrix.yml deleted file mode 100644 index 42271f1f3..000000000 --- a/.github/workflows/create-unity-matrix.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Create Unity Version Matrix - -on: - workflow_call: - inputs: - event-name: - description: 'Event name (pull_request, push, etc.)' - required: true - type: string - outputs: - unity-matrix: - description: 'Unity version matrix' - value: ${{ jobs.create-unity-matrix.outputs.unity-matrix }} - -env: - # Unity versions used in PRs - PR_UNITY_VERSIONS: '["2022.3", "6000.0", "6000.3"]' - # Unity versions used on main branch - FULL_UNITY_VERSIONS: '["2021.3", "2022.3", "6000.0", "6000.3"]' - -jobs: - create-unity-matrix: - runs-on: ubuntu-latest - outputs: - unity-matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Set Unity version matrices based on event type - id: set-matrix - shell: bash - env: - EVENT_NAME: ${{ inputs.event-name }} - PR_UNITY_VERSIONS_VALUE: ${{ env.PR_UNITY_VERSIONS }} - FULL_UNITY_VERSIONS_VALUE: ${{ env.FULL_UNITY_VERSIONS }} - run: | - if [[ "$EVENT_NAME" == "pull_request" ]]; then - versions="$PR_UNITY_VERSIONS_VALUE" - else - versions="$FULL_UNITY_VERSIONS_VALUE" - fi - - # Unity version matrix - echo "matrix={\"unity-version\":$versions}" >> $GITHUB_OUTPUT \ No newline at end of file