Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
- "**.md"
- "**.txt"
workflow_dispatch: # e.g. to manually trigger on foreign PRs
inputs:
capture-corpus:
description: "Capture the raw envelopes and debug files the integration tests produce, as artifacts (see docs/envelope-capture.md). Slower, and the event assertions fail by design."
type: boolean
default: false

env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
Expand Down Expand Up @@ -142,6 +147,8 @@ jobs:
build_platform: WebGL
env:
UNITY_PATH: docker exec unity unity-editor
# Empty unless a capture run was dispatched; see docs/envelope-capture.md.
SENTRY_CAPTURE_PATH: ${{ inputs.capture-corpus && format('test/IntegrationTest/capture/webgl-{0}', matrix.unity-version) || '' }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down Expand Up @@ -181,7 +188,10 @@ jobs:
- name: Extract project archive
run: tar -xvzf test-project.tar.gz

# Restored from an earlier run via restore-keys, so it can carry stale build output
# into the symbol-upload paths. Capture runs need debug ids that match the app.
- name: Restore Unity Library cache
if: ${{ !inputs.capture-corpus }}
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: samples/IntegrationTest/Library
Expand All @@ -190,20 +200,21 @@ jobs:
it-library-ubuntu-${{ matrix.unity-version }}-

- name: Restore cached build without Sentry
if: ${{ !inputs.capture-corpus }}
id: cache-build-nosentry
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: samples/IntegrationTest/Build-NoSentry
key: build-nosentry-${{ matrix.build_platform }}-${{ matrix.unity-version }}

- name: Build without Sentry SDK
if: steps.cache-build-nosentry.outputs.cache-hit != 'true'
if: ${{ !inputs.capture-corpus && steps.cache-build-nosentry.outputs.cache-hit != 'true' }}
run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH" -Platform "$env:BUILD_PLATFORM" -BuildDirName "Build-NoSentry"
env:
BUILD_PLATFORM: ${{ matrix.build_platform }}

- name: Save cached build without Sentry
if: github.ref == 'refs/heads/main' && steps.cache-build-nosentry.outputs.cache-hit != 'true'
if: ${{ !inputs.capture-corpus && github.ref == 'refs/heads/main' && steps.cache-build-nosentry.outputs.cache-hit != 'true' }}
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: samples/IntegrationTest/Build-NoSentry
Expand Down Expand Up @@ -247,12 +258,14 @@ jobs:
UNITY_VERSION: ${{ matrix.unity-version }}

- name: Compare build sizes
if: ${{ !inputs.capture-corpus }}
run: ./test/Scripts.Integration.Test/measure-build-size.ps1 -Path1 "samples/IntegrationTest/Build-NoSentry" -Path2 "samples/IntegrationTest/Build" -Platform "$env:BUILD_PLATFORM" -UnityVersion "$env:UNITY_VERSION"
env:
BUILD_PLATFORM: ${{ matrix.build_platform }}
UNITY_VERSION: ${{ matrix.unity-version }}

- name: Upload build size measurement
if: ${{ !inputs.capture-corpus }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: build-size-${{ matrix.platform }}-${{ matrix.unity-version }}
Expand Down Expand Up @@ -301,6 +314,7 @@ jobs:
uses: ./.github/workflows/test-build-android.yml
with:
unity-version: ${{ matrix.unity-version }}
capture: ${{ inputs.capture-corpus || false }}
Comment thread
sentry-warden[bot] marked this conversation as resolved.

test-run-android:
name: Run Android ${{ matrix.unity-version }} Integration Test
Expand All @@ -314,6 +328,7 @@ jobs:
unity-version: ${{ matrix.unity-version }}
api-level: ${{ matrix.api-level }}
init-type: ${{ matrix.init-type }}
capture: ${{ inputs.capture-corpus || false }}
strategy:
fail-fast: false
matrix:
Expand All @@ -336,10 +351,13 @@ jobs:
uses: ./.github/workflows/test-build-ios.yml
with:
unity-version: ${{ matrix.unity-version }}
capture: ${{ inputs.capture-corpus || false }}

test-compile-ios:
name: Compile iOS ${{ matrix.unity-version }} Test
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
# `!cancelled()` so one failed build entry does not skip the whole platform: `needs` gates on
# the aggregate conclusion, which `fail-fast: false` does not change.
if: ${{ !cancelled() && needs.create-unity-matrix.result == 'success' && !startsWith(github.ref, 'refs/heads/release/') }}
needs: [test-build-ios, create-unity-matrix]
strategy:
fail-fast: false
Expand All @@ -350,16 +368,18 @@ jobs:
with:
unity-version: ${{ matrix.unity-version }}
init-type: ${{ matrix.init-type }}
capture: ${{ inputs.capture-corpus || false }}

test-run-ios:
name: Run iOS ${{ matrix.unity-version }} Integration Test
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
if: ${{ !cancelled() && needs.create-unity-matrix.result == 'success' && !startsWith(github.ref, 'refs/heads/release/') }}
needs: [test-compile-ios, create-unity-matrix]
uses: ./.github/workflows/test-run-ios.yml
with:
unity-version: ${{ matrix.unity-version }}
ios-version: ${{ matrix.ios-version }}
init-type: ${{ matrix.init-type }}
capture: ${{ inputs.capture-corpus || false }}
secrets:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_TEST_DSN: ${{ secrets.SENTRY_TEST_DSN }}
Expand Down Expand Up @@ -394,6 +414,7 @@ jobs:
uses: ./.github/workflows/test-run-webgl.yml
with:
unity-version: ${{ matrix.unity-version }}
capture: ${{ inputs.capture-corpus || false }}

test-build-linux:
name: Build Linux ${{ matrix.unity-version }} Integration Test
Expand All @@ -410,6 +431,7 @@ jobs:
uses: ./.github/workflows/test-build-linux.yml
with:
unity-version: ${{ matrix.unity-version }}
capture: ${{ inputs.capture-corpus || false }}

test-build-windows:
name: Build Windows ${{ matrix.unity-version }} Integration Test
Expand All @@ -426,6 +448,7 @@ jobs:
uses: ./.github/workflows/test-build-windows.yml
with:
unity-version: ${{ matrix.unity-version }}
capture: ${{ inputs.capture-corpus || false }}

test-build-macos:
name: Build macOS ${{ matrix.unity-version }} Integration Test
Expand All @@ -442,6 +465,7 @@ jobs:
uses: ./.github/workflows/test-build-macos.yml
with:
unity-version: ${{ matrix.unity-version }}
capture: ${{ inputs.capture-corpus || false }}

test-run-linux:
name: Run Linux ${{ matrix.backend }} ${{ matrix.unity-version }} Integration Test
Expand All @@ -460,6 +484,7 @@ jobs:
unity-version: ${{ matrix.unity-version }}
platform: linux
backend: ${{ matrix.backend }}
capture: ${{ inputs.capture-corpus || false }}

test-run-windows:
name: Run Windows ${{ matrix.backend }} ${{ matrix.unity-version }} Integration Test
Expand All @@ -478,6 +503,7 @@ jobs:
unity-version: ${{ matrix.unity-version }}
platform: windows
backend: ${{ matrix.backend }}
capture: ${{ inputs.capture-corpus || false }}

test-run-macos:
name: Run macOS ${{ matrix.backend }} ${{ matrix.unity-version }} Integration Test
Expand All @@ -496,11 +522,13 @@ jobs:
unity-version: ${{ matrix.unity-version }}
platform: macos
backend: ${{ matrix.backend }}
capture: ${{ inputs.capture-corpus || false }}

build-size-summary:
name: Build Size
runs-on: ubuntu-latest
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
# Nothing to summarise in capture mode - the no-Sentry builds it compares against are skipped.
if: ${{ !inputs.capture-corpus && !startsWith(github.ref, 'refs/heads/release/') }}
needs: [test-build-webgl, test-build-android, test-compile-ios, test-build-linux, test-build-windows, test-build-macos]
steps:
- name: Checkout
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/test-build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
unity-version:
required: true
type: string
capture:
required: false
type: boolean
default: false
description: "Capture the envelopes and debug files this job produces - see docs/envelope-capture.md"
secrets:
UNITY_LICENSE_SERVER_CONFIG:
required: true
Expand All @@ -25,6 +30,8 @@ jobs:
GITHUB_ACTOR: ${{ github.actor }}
UNITY_PATH: docker exec unity unity-editor
UNITY_VERSION: ${{ inputs.unity-version }}
# Empty unless a capture run was dispatched; see docs/envelope-capture.md.
SENTRY_CAPTURE_PATH: ${{ inputs.capture && format('test/IntegrationTest/capture/android-{0}', inputs.unity-version) || '' }}

steps:
- name: Checkout
Expand Down Expand Up @@ -52,7 +59,10 @@ jobs:
- name: Extract project archive
run: tar -xvzf test-project.tar.gz

# Restored from an earlier run via restore-keys, so it can carry stale build output
# into the symbol-upload paths. Capture runs need debug ids that match the app.
- name: Restore Unity Library cache
if: ${{ !inputs.capture }}
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: samples/IntegrationTest/Library
Expand All @@ -61,18 +71,19 @@ jobs:
it-library-ubuntu-${{ env.UNITY_VERSION }}-

- name: Restore cached build without Sentry
if: ${{ !inputs.capture }}
id: cache-build-nosentry
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: samples/IntegrationTest/Build-NoSentry
key: build-nosentry-Android-${{ inputs.unity-version }}

- name: Build without Sentry SDK
if: steps.cache-build-nosentry.outputs.cache-hit != 'true'
if: ${{ !inputs.capture && steps.cache-build-nosentry.outputs.cache-hit != 'true' }}
run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH" -Platform "Android" -BuildDirName "Build-NoSentry"

- name: Save cached build without Sentry
if: github.ref == 'refs/heads/main' && steps.cache-build-nosentry.outputs.cache-hit != 'true'
if: ${{ !inputs.capture && github.ref == 'refs/heads/main' && steps.cache-build-nosentry.outputs.cache-hit != 'true' }}
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: samples/IntegrationTest/Build-NoSentry
Expand Down Expand Up @@ -110,9 +121,11 @@ jobs:
run: ./test/Scripts.Integration.Test/assert-symbol-upload.ps1 -LogPath samples/IntegrationTest/Logs/sentry-symbols-upload.log

- name: Compare build sizes (Runtime)
if: ${{ !inputs.capture }}
run: ./test/Scripts.Integration.Test/measure-build-size.ps1 -Path1 "samples/IntegrationTest/Build-NoSentry" -Path2 "samples/IntegrationTest/Build" -Platform "Android" -UnityVersion "$env:UNITY_VERSION"

- name: Upload build size measurement
if: ${{ !inputs.capture }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: build-size-Android-${{ env.UNITY_VERSION }}
Expand Down Expand Up @@ -176,3 +189,11 @@ jobs:
!samples/IntegrationTest/Build/*_BackUpThisFolder_ButDontShipItWithYourGame
retention-days: 14 # Lower retention period - we only need this to retry CI.

- name: Upload captured corpus
if: ${{ always() && inputs.capture }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: corpus-android-${{ inputs.unity-version }}
path: test/IntegrationTest/capture/
if-no-files-found: warn
retention-days: 14
Comment thread
sentry-warden[bot] marked this conversation as resolved.
17 changes: 15 additions & 2 deletions .github/workflows/test-build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
unity-version:
required: true
type: string
capture:
required: false
type: boolean
default: false
description: "Capture the envelopes and debug files this job produces - see docs/envelope-capture.md"
secrets:
UNITY_LICENSE_SERVER_CONFIG:
required: true
Expand All @@ -31,6 +36,8 @@ jobs:
GITHUB_ACTOR: ${{ github.actor }}
UNITY_PATH: docker exec unity unity-editor
UNITY_VERSION: ${{ inputs.unity-version }}
# Empty unless a capture run was dispatched; see docs/envelope-capture.md.
SENTRY_CAPTURE_PATH: ${{ inputs.capture && format('test/IntegrationTest/capture/ios-{0}', inputs.unity-version) || '' }}

steps:
- name: Checkout
Expand Down Expand Up @@ -58,7 +65,10 @@ jobs:
- name: Extract project archive
run: tar -xvzf test-project.tar.gz

# Restored from an earlier run via restore-keys, so it can carry stale build output
# into the symbol-upload paths. Capture runs need debug ids that match the app.
- name: Restore Unity Library cache
if: ${{ !inputs.capture }}
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: samples/IntegrationTest/Library
Expand All @@ -67,30 +77,33 @@ jobs:
it-library-ubuntu-${{ env.UNITY_VERSION }}-

- name: Restore cached build without Sentry
if: ${{ !inputs.capture }}
id: cache-build-nosentry
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: samples/IntegrationTest/Build-NoSentry
key: build-nosentry-iOS-${{ inputs.unity-version }}

- name: Build without Sentry SDK
if: steps.cache-build-nosentry.outputs.cache-hit != 'true'
if: ${{ !inputs.capture && steps.cache-build-nosentry.outputs.cache-hit != 'true' }}
run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH" -Platform "iOS" -BuildDirName "Build-NoSentry"

- name: Save cached build without Sentry
if: github.ref == 'refs/heads/main' && steps.cache-build-nosentry.outputs.cache-hit != 'true'
if: ${{ !inputs.capture && github.ref == 'refs/heads/main' && steps.cache-build-nosentry.outputs.cache-hit != 'true' }}
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: samples/IntegrationTest/Build-NoSentry
key: build-nosentry-iOS-${{ inputs.unity-version }}

- name: Create archive for build without Sentry
if: ${{ !inputs.capture }}
shell: bash
run: |
rm -rf samples/IntegrationTest/Build-NoSentry/*_BackUpThisFolder_ButDontShipItWithYourGame
tar -cvzf test-app-no-sentry.tar.gz samples/IntegrationTest/Build-NoSentry

- name: Upload build without Sentry
if: ${{ !inputs.capture }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: testapp-ios-no-sentry-${{ env.UNITY_VERSION }}
Expand Down
Loading
Loading