@@ -162,8 +162,18 @@ jobs:
162162 - name : Extract project archive
163163 run : tar -xvzf test-project.tar.gz
164164
165- # - name: Build without Sentry SDK
166- # run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "${{ env.UNITY_PATH }}" -Platform "${{ matrix.platform }}"
165+ - name : Restore cached build without Sentry
166+ id : cache-build-nosentry
167+ uses : actions/cache@v4
168+ with :
169+ path : samples/IntegrationTest/Build-NoSentry
170+ key : build-nosentry-${{ matrix.build_platform }}-${{ matrix.unity-version }}
171+
172+ - name : Build without Sentry SDK
173+ if : steps.cache-build-nosentry.outputs.cache-hit != 'true'
174+ run : ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH" -Platform "$env:BUILD_PLATFORM" -CheckSymbols:$false -BuildDirName "Build-NoSentry"
175+ env :
176+ BUILD_PLATFORM : ${{ matrix.build_platform }}
167177
168178 - name : Download UPM package
169179 uses : vaind/download-artifact@e7141b6a94ef28aa3d828b52830cfa1f406a1848 # v4-with-wait-timeout
@@ -189,6 +199,19 @@ jobs:
189199 CHECK_SYMBOLS : ${{ matrix.check_symbols }}
190200 UNITY_VERSION : ${{ matrix.unity-version }}
191201
202+ - name : Compare build sizes
203+ 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"
204+ env :
205+ BUILD_PLATFORM : ${{ matrix.build_platform }}
206+ UNITY_VERSION : ${{ matrix.unity-version }}
207+
208+ - name : Upload build size measurement
209+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
210+ with :
211+ name : build-size-${{ matrix.platform }}-${{ matrix.unity-version }}
212+ path : build-size-measurements/*.json
213+ retention-days : 1
214+
192215 # We create tar explicitly because upload-artifact is slow for many files.
193216 - name : Create archive
194217 shell : bash
@@ -390,8 +413,16 @@ jobs:
390413 - name : Extract project archive
391414 run : tar -xvzf test-project.tar.gz
392415
416+ - name : Restore cached build without Sentry
417+ id : cache-build-nosentry
418+ uses : actions/cache@v4
419+ with :
420+ path : samples/IntegrationTest/Build-NoSentry
421+ key : build-nosentry-Windows-${{ matrix.unity-version }}
422+
393423 - name : Build without Sentry SDK
394- run : ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH"
424+ if : steps.cache-build-nosentry.outputs.cache-hit != 'true'
425+ run : ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH" -CheckSymbols:$false -BuildDirName "Build-NoSentry"
395426
396427 - name : Download UPM package
397428 uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
@@ -412,8 +443,39 @@ jobs:
412443 env :
413444 UNITY_VERSION : ${{ matrix.unity-version }}
414445
446+ - name : Compare build sizes
447+ run : ./test/Scripts.Integration.Test/measure-build-size.ps1 -Path1 "samples/IntegrationTest/Build-NoSentry" -Path2 "samples/IntegrationTest/Build" -Platform "Windows" -UnityVersion "$env:UNITY_VERSION"
448+ env :
449+ UNITY_VERSION : ${{ matrix.unity-version }}
450+
451+ - name : Upload build size measurement
452+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
453+ with :
454+ name : build-size-Windows-${{ matrix.unity-version }}
455+ path : build-size-measurements/*.json
456+ retention-days : 1
457+
415458 - name : Run Smoke Test
416459 run : ./test/Scripts.Integration.Test/run-smoke-test.ps1 -Smoke
417460
418461 - name : Run Crash Test
419- run : ./test/Scripts.Integration.Test/run-smoke-test.ps1 -Crash
462+ run : ./test/Scripts.Integration.Test/run-smoke-test.ps1 -Crash
463+
464+ build-size-summary :
465+ name : Build Size
466+ runs-on : ubuntu-latest
467+ if : ${{ !startsWith(github.ref, 'refs/heads/release/') }}
468+ needs : [smoke-test-build, smoke-test-build-android, smoke-test-compile-ios, desktop-smoke-test]
469+ steps :
470+ - name : Checkout
471+ uses : actions/checkout@v3
472+
473+ - name : Download all build size measurements
474+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
475+ with :
476+ pattern : build-size-*
477+ path : build-size-measurements
478+
479+ - name : Create consolidated summary
480+ shell : pwsh
481+ run : ./scripts/create-build-size-summary.ps1
0 commit comments