Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Unify main & non-main CI runs #1941

Merged
merged 48 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d5cdc09
reworked android device tests
bitsandfoxes Dec 16, 2024
24ab788
fix emulator
bitsandfoxes Dec 16, 2024
6324708
fixed log
bitsandfoxes Dec 16, 2024
20c69d0
closing this should not be that hard
bitsandfoxes Dec 16, 2024
91c4bfa
wait for emulator
bitsandfoxes Dec 17, 2024
5ca3ee2
API levels
bitsandfoxes Dec 17, 2024
c8cea8c
fail test
bitsandfoxes Dec 17, 2024
8bc2a64
fixed KVM permissions
bitsandfoxes Dec 17, 2024
bf2fc93
exit instead of return
bitsandfoxes Dec 17, 2024
a727aa8
simplify emulator setup
bitsandfoxes Dec 17, 2024
b40efd1
increase timeout. by a lot.
bitsandfoxes Dec 17, 2024
7a23993
fix OnQuit detection
bitsandfoxes Dec 18, 2024
5271f5f
log structure
bitsandfoxes Dec 18, 2024
8d94d03
timeout for getpid
bitsandfoxes Dec 18, 2024
28e92ae
log quit even later
bitsandfoxes Dec 18, 2024
7ccbc10
logging and delay
bitsandfoxes Dec 18, 2024
deb2c35
smoke tester logging
bitsandfoxes Dec 18, 2024
6bc40fe
always log logcat
bitsandfoxes Dec 18, 2024
1f44a1e
make it run solo
bitsandfoxes Dec 18, 2024
ba08950
need to cache the logs
bitsandfoxes Dec 18, 2024
157eb7e
don't clear logcat
bitsandfoxes Dec 18, 2024
5c7c3ee
forgot to initialize
bitsandfoxes Dec 18, 2024
e263851
reduce timeout
bitsandfoxes Dec 18, 2024
979d39d
always retry
bitsandfoxes Dec 18, 2024
c9232c8
fixed log caching
bitsandfoxes Dec 18, 2024
04690b9
fixed retry
bitsandfoxes Dec 18, 2024
f00e990
increased timeout
bitsandfoxes Dec 18, 2024
e0e72eb
added timing logging
bitsandfoxes Dec 18, 2024
a68505e
fixed retry success check
bitsandfoxes Dec 18, 2024
ea025cb
fixed API
bitsandfoxes Dec 18, 2024
9ab10eb
run CI
bitsandfoxes Dec 18, 2024
bf8ae36
wrap running tests in retry
bitsandfoxes Dec 18, 2024
d4ad433
typo
bitsandfoxes Dec 18, 2024
460f0b3
don't exit on pid issue
bitsandfoxes Dec 18, 2024
a16e677
can't write-error
bitsandfoxes Dec 18, 2024
1e61dde
logging
bitsandfoxes Dec 18, 2024
d1a9755
restored flow
bitsandfoxes Dec 18, 2024
9163732
timeout for starting activity
bitsandfoxes Dec 18, 2024
4beee9d
removed retry wrapper for android smoke test job
bitsandfoxes Dec 19, 2024
d624243
simplification
bitsandfoxes Dec 19, 2024
11e8564
fixed boolean
bitsandfoxes Dec 19, 2024
2b3e6b4
fixed missing platform on iOS
bitsandfoxes Dec 19, 2024
64453c3
using 0/1 instead of string
bitsandfoxes Dec 19, 2024
dbbea6a
no more non-main nonsense
bitsandfoxes Dec 19, 2024
59de327
missed one check
bitsandfoxes Dec 20, 2024
ddb5b2b
merged
bitsandfoxes Dec 20, 2024
c2ae0b3
Merge branch 'main' into feat/init-native-first
bitsandfoxes Jan 8, 2025
edcfedf
Apply suggestions from code review
bitsandfoxes Jan 8, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/android-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ jobs:
with:
name: testapp-android-logs-${{ inputs.api-level }}-${{ inputs.unity-version }}-${{ inputs.try }}
path: ${{ env.ARTIFACTS_PATH }}
retention-days: 14
retention-days: 14
bitsandfoxes marked this conversation as resolved.
Show resolved Hide resolved
71 changes: 19 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,19 @@ jobs:
unity-version: ["2019", "2022", "6000"]
platform: ["Android", "WebGL", "Linux", "iOS"]
include:
- platform: iOS
check_symbols: false
build_platform: iOS
- platform: Android
check_symbols: false
build_platform: Android-Export
- 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:
Expand Down Expand Up @@ -316,54 +327,10 @@ jobs:
run: ./test/Scripts.Integration.Test/add-sentry.ps1 -UnityPath "${{ env.UNITY_PATH }}"

- name: Configure Sentry
run: |
$isAndroid = ('${{ matrix.platform }}' -eq 'Android')
$isNotMainBranch = ('${{ github.ref_name }}' -ne 'main')
$platform = if ($isAndroid -and $isNotMainBranch) { 'Android-Export' } else { '${{ matrix.platform }}' }

./test/Scripts.Integration.Test/configure-sentry.ps1 -UnityPath "${{ env.UNITY_PATH }}" -Platform $platform -CheckSymbols

# Dear lord, I don't know why we have to do this: If we do not "pre-build" the project then `exportAsGoogleAndroidProject` will stay `false` in `IPostGenerateGradleAndroidProject`
# and breaking all further steps in CI
# Things I tried:
# 1. Setting the flag and restarting the editor prior to build
# 2. Setting the flag and reloading the domain in a step prior to building
# 3. Reloading the domain prior to building (does not work - build fails with a domain reload pending)
- name: Pre-Build Project for Unity 6 and Android
continue-on-error: true
if: ${{ matrix.unity-version == '6000' && matrix.platform == 'Android' }}
run: |
$platform = '${{ matrix.platform }}'
if ('${{ github.ref_name }}' -ne 'main')
{
$checkSymbols = $false
$platform = 'Android-Export'
}
else
{
$checkSymbols = $false
}

./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "${{ env.UNITY_PATH }}" -Platform $platform -CheckSymbols:$checkSymbols -UnityVersion "${{ matrix.unity-version }}"
Remove-Item -Path samples/IntegrationTest/Build -Recurse -Force -Confirm:$false

run: ./test/Scripts.Integration.Test/configure-sentry.ps1 -UnityPath "${{ env.UNITY_PATH }}" -Platform ${{ matrix.build_platform }} -CheckSymbols

- name: Build Project
run: |
$platform = '${{ matrix.platform }}'
if ($platform -eq 'iOS')
{
$checkSymbols = $false
}
elseif (($platform -eq 'Android') -and ('${{ github.ref_name }}' -ne 'main'))
{
$checkSymbols = $false
$platform = 'Android-Export'
}
else
{
$checkSymbols = $true
}
./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "${{ env.UNITY_PATH }}" -Platform $platform -CheckSymbols:$checkSymbols -UnityVersion "${{ matrix.unity-version }}"
run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "${{ env.UNITY_PATH }}" -Platform ${{ matrix.build_platform }} -CheckSymbols:$${{ matrix.check_symbols }} -UnityVersion "${{ matrix.unity-version }}"

# We create tar explicitly because upload-artifact is slow for many files.
- name: Create archive
Expand Down Expand Up @@ -513,11 +480,11 @@ jobs:

- name: Setup Android
uses: android-actions/setup-android@7c5672355aaa8fde5f97a91aa9a99616d1ace6bc # pin@v2
if: ${{ matrix.platform == 'Android' && github.ref_name != 'main' }}
if: ${{ matrix.platform == 'Android' }}

- name: Setup NDK
uses: nttld/setup-ndk@8c3b609ff4d54576ea420551943fd34b4d03b0dc # pin@v1
if: ${{ matrix.platform == 'Android' && github.ref_name != 'main' }}
if: ${{ matrix.platform == 'Android' }}
id: setup-ndk
with:
ndk-version: ${{ matrix.ndk }}
Expand All @@ -526,22 +493,22 @@ jobs:
# We modify the exported gradle project to deal with the different build-environment
# I.e. we're fixing the paths for SDK & NDK that have been hardcoded to point at the Unity installation
- name: Modify gradle project
if: ${{ matrix.platform == 'Android' && github.ref_name != 'main' }}
if: ${{ matrix.platform == 'Android' }}
run: |
./test/Scripts.Integration.Test/modify-gradle-project.ps1 `
-AndroidSdkRoot $env:ANDROID_SDK_ROOT `
-NdkPath ${{ steps.setup-ndk.outputs.ndk-path }} `
-UnityVersion ${{ matrix.unity-version }}

- name: Setup JDK 17 for Unity 6
if: ${{ matrix.platform == 'Android' && github.ref_name != 'main' && matrix.unity-version == '6000' }}
if: ${{ matrix.platform == 'Android' && matrix.unity-version == '6000' }}
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Android smoke test
if: ${{ matrix.platform == 'Android' && github.ref_name != 'main' }}
if: ${{ matrix.platform == 'Android' }}
run: ./scripts/smoke-test-android.ps1 Build -IsIntegrationTest -UnityVersion "${{ matrix.unity-version }}"
env:
JAVA_HOME: ${{ env.JAVA_HOME }}
Expand Down
Loading