feat: Structured Logging #7984
Workflow file for this run
This file contains hidden or 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" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release/* | |
| pull_request: | |
| paths-ignore: | |
| - "**.md" | |
| - "**.txt" | |
| workflow_dispatch: # e.g. to manually trigger on foreign PRs | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| DOTNET_NOLOGO: 1 | |
| defaults: | |
| run: | |
| shell: pwsh | |
| jobs: | |
| cancel-previous-workflow: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Cancel Previous Runs | |
| uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected] | |
| with: | |
| access_token: ${{ github.token }} | |
| create-unity-matrix: | |
| uses: ./.github/workflows/create-unity-matrix.yml | |
| with: | |
| event-name: ${{ github.event_name }} | |
| sdk: | |
| strategy: | |
| matrix: | |
| include: | |
| - target: Android | |
| host: ubuntu-latest | |
| - target: Linux | |
| host: ubuntu-latest | |
| - target: Windows | |
| host: windows-latest | |
| - target: Cocoa | |
| host: macos-latest | |
| uses: ./.github/workflows/sdk.yml | |
| with: | |
| target: ${{ matrix.target }} | |
| runsOn: ${{ matrix.host }} | |
| build-unity-sdk: | |
| name: Build Unity SDK | |
| secrets: inherit | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Building the SDK with Unity 2022 and newer requires ns2.1 - skipping for now | |
| unity-version: ["2021.3"] | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| unity-version: ${{ matrix.unity-version }} | |
| package-validation: | |
| name: UPM Package validation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Download UPM package | |
| uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848 # v4-with-wait-timeout | |
| with: | |
| name: ${{ github.sha }} | |
| wait-timeout: 3600 | |
| - name: Verify package content against snapshot | |
| # If this step fails, you can accept the new file content by | |
| # running the following script locally with 'accept' as an argument | |
| # and committing the new snapshot file to your branch. i.e: | |
| # ./test/Scripts.Tests/test-pack-contents.ps1 accept | |
| run: ./test/Scripts.Tests/test-pack-contents.ps1 | |
| # This produces the `samples/IntegrationTest` as `smoke-test-${{ matrix.unity-version }}`. | |
| smoke-test-create: | |
| name: Create ${{ matrix.unity-version }} Smoke 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) }} | |
| uses: ./.github/workflows/smoke-test-create.yml | |
| with: | |
| unity-version: ${{ matrix.unity-version }} | |
| # A Linux, docker-based build to prepare a game ("player") for some platforms. The tests run in `smoke-test-run`. | |
| smoke-test-build: | |
| name: Build ${{ matrix.platform }} ${{ matrix.unity-version }} Smoke Test | |
| if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} | |
| needs: [smoke-test-create, create-unity-matrix] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} | |
| platform: ["WebGL", "Linux"] | |
| include: | |
| - platform: WebGL | |
| check_symbols: true | |
| build_platform: WebGL | |
| - platform: Linux | |
| image-suffix: "-il2cpp" | |
| check_symbols: true | |
| build_platform: Linux | |
| env: | |
| UNITY_PATH: docker exec unity unity-editor | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Free Disk Space (Ubuntu) | |
| uses: jlumbroso/free-disk-space@f68fdb76e2ea636224182cfb7377ff9a1708f9b8 # v1.3.0 | |
| with: | |
| android: true | |
| dotnet: false | |
| haskell: true | |
| large-packages: false | |
| docker-images: false | |
| swap-storage: true | |
| - run: echo "::add-mask::$LICENSE_SERVER_URL" | |
| env: | |
| LICENSE_SERVER_URL: ${{ secrets.LICENSE_SERVER_URL }} | |
| - name: Docker Login | |
| uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pinned v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Start the Unity docker container | |
| run: ./scripts/ci-docker.sh "$UNITY_VERSION" "$PLATFORM_WITH_SUFFIX" "$UNITY_LICENSE_SERVER_CONFIG" | |
| shell: bash | |
| env: | |
| UNITY_VERSION: ${{ matrix.unity-version }} | |
| PLATFORM: ${{ matrix.platform }} | |
| IMAGE_SUFFIX: ${{ matrix.image-suffix }} | |
| PLATFORM_WITH_SUFFIX: ${{ matrix.platform }}${{ matrix.image-suffix }} | |
| UNITY_LICENSE_SERVER_CONFIG: ${{ secrets.UNITY_LICENSE_SERVER_CONFIG }} | |
| - name: Download IntegrationTest project | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| name: smoke-test-${{ matrix.unity-version }} | |
| - name: Extract project archive | |
| run: tar -xvzf test-project.tar.gz | |
| # - name: Build without Sentry SDK | |
| # run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "${{ env.UNITY_PATH }}" -Platform "${{ matrix.platform }}" | |
| - name: Download UPM package | |
| uses: vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848 # v4-with-wait-timeout | |
| with: | |
| name: ${{ github.sha }} | |
| wait-timeout: 3600 | |
| - name: Extract UPM package | |
| run: ./test/Scripts.Integration.Test/extract-package.ps1 | |
| - name: Add Sentry to the project | |
| run: ./test/Scripts.Integration.Test/add-sentry.ps1 -UnityPath "$env:UNITY_PATH" | |
| - name: Configure Sentry | |
| run: ./test/Scripts.Integration.Test/configure-sentry.ps1 -UnityPath "$env:UNITY_PATH" -Platform "$env:BUILD_PLATFORM" -CheckSymbols | |
| env: | |
| BUILD_PLATFORM: ${{ matrix.build_platform }} | |
| - name: Build Project | |
| run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH" -Platform "$env:BUILD_PLATFORM" -CheckSymbols:$([System.Convert]::ToBoolean($env:CHECK_SYMBOLS)) -UnityVersion "$env:UNITY_VERSION" | |
| env: | |
| BUILD_PLATFORM: ${{ matrix.build_platform }} | |
| CHECK_SYMBOLS: ${{ matrix.check_symbols }} | |
| UNITY_VERSION: ${{ matrix.unity-version }} | |
| # We create tar explicitly because upload-artifact is slow for many files. | |
| - name: Create archive | |
| shell: bash | |
| run: | | |
| # Note: remove local.properties file that contains Android SDK & NDK paths in the Unity installation. | |
| rm -rf samples/IntegrationTest/Build/*_BackUpThisFolder_ButDontShipItWithYourGame | |
| tar -cvzf test-app-runtime.tar.gz samples/IntegrationTest/Build | |
| # Upload runtime initialization build | |
| - name: Upload test app | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: testapp-${{ matrix.platform }}-${{ matrix.unity-version }}-runtime | |
| if-no-files-found: error | |
| path: test-app-runtime.tar.gz | |
| retention-days: 14 | |
| - name: Upload IntegrationTest project on failure | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: failed-project-${{ matrix.platform }}-${{ matrix.unity-version }} | |
| path: | | |
| samples/IntegrationTest | |
| !samples/IntegrationTest/Build/*_BackUpThisFolder_ButDontShipItWithYourGame | |
| # Lower retention period - we only need this to retry CI. | |
| retention-days: 14 | |
| smoke-test-build-android: | |
| name: Build Android ${{ matrix.unity-version }} Smoke Test | |
| if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} | |
| needs: [smoke-test-create, create-unity-matrix] | |
| secrets: inherit | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix) }} | |
| uses: ./.github/workflows/smoke-test-build-android.yml | |
| with: | |
| unity-version: ${{ matrix.unity-version }} | |
| smoke-test-run-android: | |
| name: Run Android ${{ matrix.unity-version }} Smoke Test | |
| if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} | |
| needs: [smoke-test-build-android, create-unity-matrix] | |
| uses: ./.github/workflows/smoke-test-run-android.yml | |
| with: | |
| unity-version: ${{ matrix.unity-version }} | |
| api-level: ${{ matrix.api-level }} | |
| init-type: ${{ matrix.init-type }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} | |
| api-level: [30, 31, 34] | |
| init-type: ["runtime", "buildtime"] | |
| smoke-test-build-ios: | |
| name: Build iOS ${{ matrix.unity-version }} Smoke Test | |
| if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} | |
| needs: [smoke-test-create, create-unity-matrix] | |
| secrets: inherit | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix) }} | |
| uses: ./.github/workflows/smoke-test-build-ios.yml | |
| with: | |
| unity-version: ${{ matrix.unity-version }} | |
| smoke-test-compile-ios: | |
| name: Compile iOS ${{ matrix.unity-version }} Smoke Test | |
| if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} | |
| needs: [smoke-test-build-ios, create-unity-matrix] | |
| secrets: inherit | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} | |
| init-type: ["runtime", "buildtime"] | |
| uses: ./.github/workflows/smoke-test-compile-ios.yml | |
| with: | |
| unity-version: ${{ matrix.unity-version }} | |
| init-type: ${{ matrix.init-type }} | |
| smoke-test-run-ios: | |
| name: Run iOS ${{ matrix.unity-version }} Smoke Test | |
| if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} | |
| needs: [smoke-test-compile-ios, create-unity-matrix] | |
| uses: ./.github/workflows/smoke-test-run-ios.yml | |
| with: | |
| unity-version: ${{ matrix.unity-version }} | |
| ios-version: ${{ matrix.ios-version }} | |
| init-type: ${{ matrix.init-type }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} | |
| 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. | |
| # https://developer.apple.com/support/app-store/ shows that of all iOS devices | |
| # - `iOS 18`: 88 % | |
| # - `iOS 17`: 17 % | |
| # - the rest: 4 % | |
| # as of August, 2025. Therefore, let's stick to testing iOS 17 and `latest` for now. | |
| # Numbers as string otherwise GH will reformat the runtime numbers removing the fractions. | |
| # Also make sure to match the versions available here: | |
| # - https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md | |
| smoke-test-run: | |
| name: Run ${{ matrix.platform }} ${{ matrix.unity-version }} Smoke Test | |
| if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} | |
| needs: [smoke-test-build, create-unity-matrix] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} | |
| platform: ["WebGL", "Linux"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Download test app artifact | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| id: download | |
| with: | |
| name: testapp-${{ matrix.platform }}-${{ matrix.unity-version }}-runtime | |
| - name: Extract test app | |
| run: tar -xvzf test-app-runtime.tar.gz | |
| - name: Run (WebGL) | |
| if: ${{ matrix.platform == 'WebGL' }} | |
| timeout-minutes: 10 | |
| run: | | |
| pip3 install --upgrade --user selenium urllib3 requests | |
| python3 scripts/smoke-test-webgl.py "samples/IntegrationTest/Build" | |
| - name: Run Smoke Test (Linux) | |
| if: ${{ matrix.platform == 'Linux' }} | |
| run: ./test/Scripts.Integration.Test/run-smoke-test.ps1 -Smoke | |
| - name: Run Crash Test (Linux) | |
| if: ${{ matrix.platform == 'Linux' }} | |
| run: ./test/Scripts.Integration.Test/run-smoke-test.ps1 -Crash | |
| desktop-smoke-test: | |
| name: Run ${{ matrix.os }} ${{ matrix.unity-version }} Smoke Test | |
| if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} | |
| needs: [smoke-test-create, create-unity-matrix] | |
| runs-on: ${{ matrix.os }}-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} | |
| os: ["windows"] | |
| include: | |
| - os: windows | |
| unity-modules: "windows-il2cpp" | |
| unity-config-path: "C:/ProgramData/Unity/config/" | |
| # os: ["windows", "macos"] | |
| # include: | |
| # - os: macos | |
| # unity-modules: mac-il2cpp | |
| # unity-config-path: /Library/Application Support/Unity/config/ | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
| - name: Load env | |
| id: env | |
| run: echo "unityVersion=$(./scripts/ci-env.ps1 "$env:UNITY_SCRIPT_ARG")" >> $env:GITHUB_OUTPUT | |
| env: | |
| UNITY_SCRIPT_ARG: unity${{ matrix.unity-version }} | |
| - name: Setup Unity | |
| uses: getsentry/setup-unity@3bdc8c022b6d30ecf2d21d12a564bfa55a54fa2e | |
| with: | |
| unity-version: ${{ steps.env.outputs.unityVersion }} | |
| unity-modules: ${{ matrix.unity-modules }} | |
| - run: echo "::add-mask::$LICENSE_SERVER_URL" | |
| env: | |
| LICENSE_SERVER_URL: ${{ secrets.LICENSE_SERVER_URL }} | |
| - name: Create Unity license config | |
| run: | | |
| New-Item -Path "$env:UNITY_CONFIG_PATH" -ItemType Directory | |
| Set-Content -Path "$env:UNITY_CONFIG_PATH/services-config.json" -Value "$env:UNITY_LICENSE_SERVER_CONFIG" | |
| env: | |
| UNITY_CONFIG_PATH: ${{ matrix.unity-config-path }} | |
| UNITY_LICENSE_SERVER_CONFIG: ${{ secrets.UNITY_LICENSE_SERVER_CONFIG }} | |
| - name: Download IntegrationTest project | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| name: smoke-test-${{ matrix.unity-version }} | |
| - name: Extract project archive | |
| run: tar -xvzf test-project.tar.gz | |
| - name: Build without Sentry SDK | |
| run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH" | |
| - name: Download UPM package | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| name: ${{ github.sha }} | |
| - name: Extract UPM package | |
| run: ./test/Scripts.Integration.Test/extract-package.ps1 | |
| - name: Add Sentry to the project | |
| run: ./test/Scripts.Integration.Test/add-sentry.ps1 -UnityPath "$env:UNITY_PATH" | |
| - name: Configure Sentry | |
| run: ./test/Scripts.Integration.Test/configure-sentry.ps1 -UnityPath "$env:UNITY_PATH" -CheckSymbols | |
| - name: Build with Sentry SDK | |
| run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH" -CheckSymbols -UnityVersion "$env:UNITY_VERSION" | |
| env: | |
| UNITY_VERSION: ${{ matrix.unity-version }} | |
| - name: Run Smoke Test | |
| run: ./test/Scripts.Integration.Test/run-smoke-test.ps1 -Smoke | |
| - name: Run Crash Test | |
| run: ./test/Scripts.Integration.Test/run-smoke-test.ps1 -Crash |