sentry-unity
sentry-unity copied to clipboard
Update CI workflow
trafficstars
The Problem
I've made quite a few changes and updates to CI and it's been a bit of a pain a couple of times. Different jobs but for the same platforms keep interfering, i.e.
- The job that compiles the Android app fails. This causes the iOS device tests to not run because they depend on the job to finish successfully.
- Package Validation. You're making changes to the package contents and CI won't run because Package Validation is be base for all jobs.
The Proposal
Instead, and to get rid of all the if: ${{ matrix.platform == 'Android' }} and similar checks, we could split the jobs into something like the following chart
Current setup
Proposed setup
The Plan
- [x] Split the
ci.ymlinto reusable workflows, depending on their respective target-platform. https://github.com/getsentry/sentry-unity/pull/1989 - [ ] See what can be parallelized. Some jobs do quite a bit of setup before doing any actual work, while depending on the output of previous jobs. We could utilize @vaind's download action like we do here to pause.
- [x] Merge the Android build back into one job. https://github.com/getsentry/sentry-unity/pull/1993
- The main pain-point is all the manual work we have to do to keep the lights on.
- see https://github.com/getsentry/sentry-unity/pull/1957#pullrequestreview-2543467207
- and https://github.com/getsentry/sentry-unity/blob/main/test/Scripts.Integration.Test/modify-gradle-project.ps1
- and most of what happens in https://github.com/getsentry/sentry-unity/blob/123b27079b72e33ec43a30827830b74e316e0791/.github/workflows/ci.yml#L481
- Without changing much, we could merge the compilation back into the build step. This way we could still keep the benefit of minimal Unity Editor time (helps with the build license pressure) but still rely on the local Android SDK & NDK setup the Unity installation comes with.
- The main pain-point is all the manual work we have to do to keep the lights on.
Misc Info
Build Licenses
Build-License overlap would still exist but is already prevalent due to our use of matrix to target multiple platforms with one job.
Additional context
The average times for the individual jobs are:
- Build Unity SDK: 5 min
- Create Smoke Test: 2 min
- Building
- Android: 10 min
- iOS: 6 min
- WebGL: 13 min
- Linux: 11 min
- Windows: 30 min
- Compiling SmokeTest
- Android: 5 min
- iOS: 4 min
- Running Device Test (mobile)
- Android: 5 min
- iOS: 5 min