Skip to content

bumped java

bumped java #6867

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- "**.md"
- "**.txt"
workflow_dispatch: # e.g. to manually trigger on foreign PRs
env:
LOWEST_SUPPORTED_UNITY_VERSION: 2019
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 # pin@0.11.0
with:
access_token: ${{ github.token }}
sdk:
strategy:
matrix:
include:
- target: Android
host: ubuntu-latest
- target: Linux
# Build using older Linux version to preserve sdk compatibility with old GLIBC
# See discussion in /~https://github.com/getsentry/sentry-unity/issues/1730 for more details
host: ubuntu-20.04
- target: Windows
host: windows-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: ["2019", "2020", "2021"]
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
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/') }}
secrets: inherit
strategy:
fail-fast: false
matrix:
unity-version: ["2019", "2022", "6000"]
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]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
unity-version: ["2019", "2022", "6000"]
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
with:
android: true
dotnet: false
haskell: true
large-packages: false
docker-images: false
swap-storage: true
- run: echo "::add-mask::${{ 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 '${{ matrix.unity-version }}' '${{ matrix.platform }}${{ matrix.image-suffix }}' '${{ secrets.UNITY_LICENSE_SERVER_CONFIG }}'
shell: bash
# Workaround for missing libMonoPosixHelper.so
# See /~https://github.com/getsentry/sentry-unity/pull/1295
- name: Install mono-devel
if: ${{ matrix.unity-version == '2019' }}
run: |
docker exec --user root unity apt-get update
docker exec --user root unity apt-get -y -q install mono-devel
- name: Download IntegrationTest project
uses: actions/download-artifact@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
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 ${{ matrix.build_platform }} -CheckSymbols
- name: Build Project
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
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@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@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
android-smoke-test-build:
name: Build Android ${{ matrix.unity-version }} Smoke Test
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
needs: [smoke-test-create]
secrets: inherit
strategy:
fail-fast: false
matrix:
unity-version: ["2019", "2022", "6000"]
uses: ./.github/workflows/android-smoke-test-build.yml
with:
unity-version: ${{ matrix.unity-version }}
android-smoke-test-run:
name: Run Android ${{ matrix.unity-version }} Smoke Test
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
needs: [android-smoke-test-build]
uses: ./.github/workflows/android-smoke-test-run.yml
with:
unity-version: ${{ matrix.unity-version }}
api-level: ${{ matrix.api-level }}
init-type: ${{ matrix.init-type }}
strategy:
fail-fast: false
matrix:
api-level: [30, 31, 34] # last updated January 2025
init-type: ["runtime", "buildtime"]
unity-version: ["2019", "2022", "6000"]
ios-smoke-test-build:
name: Build iOS ${{ matrix.unity-version }} Smoke Test
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
needs: [smoke-test-create]
secrets: inherit
strategy:
fail-fast: false
matrix:
unity-version: ["2019", "2022", "6000"]
uses: ./.github/workflows/ios-smoke-test-build.yml
with:
unity-version: ${{ matrix.unity-version }}
ios-smoke-test-compile:
name: Compile iOS ${{ matrix.unity-version }} Smoke Test
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
needs: [ios-smoke-test-build]
secrets: inherit
strategy:
fail-fast: false
matrix:
unity-version: ["2019", "2022", "6000"]
init-type: ["runtime", "buildtime"]
uses: ./.github/workflows/ios-smoke-test-compile.yml
with:
unity-version: ${{ matrix.unity-version }}
init-type: ${{ matrix.init-type }}
ios-smoke-test-run:
name: Run iOS ${{ matrix.unity-version }} Smoke Test
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
needs: [ios-smoke-test-compile]
uses: ./.github/workflows/ios-smoke-test-run.yml
with:
unity-version: ${{ matrix.unity-version }}
ios-version: ${{ matrix.ios-version }}
init-type: ${{ matrix.init-type }}
strategy:
fail-fast: false
matrix:
unity-version: ["2019", "2022", "6000"]
# 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 17`: 86 %
# - `iOS 16`: 11 %
# - the rest: 3 %
# as of October, 2024. Therefore, let's stick to testing iOS 16 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-13-Readme.md
ios-version: ["16.1", latest] # last updated October 2024
init-type: ["runtime", "buildtime"]
smoke-test-run:
name: Run ${{ matrix.platform }} ${{ matrix.unity-version }} Smoke Test
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
needs: [smoke-test-build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
unity-version: ["2019", "2022", "6000"]
platform: ["WebGL", "Linux"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download test app artifact
uses: actions/download-artifact@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]
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
unity-version: ["2019", "2022", "6000"]
# os: ["windows", "macos"]
os: ["windows"]
include:
- os: windows
unity-modules: windows-il2cpp
unity-config-path: C:/ProgramData/Unity/config/
# - os: macos
# unity-modules: mac-il2cpp
# unity-config-path: /Library/Application Support/Unity/config/
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Load env
id: env
run: echo "unityVersion=$(./scripts/ci-env.ps1 "unity${{ matrix.unity-version }}")" >> $env:GITHUB_OUTPUT
- name: Setup Unity
uses: getsentry/setup-unity@d84ad1d1fb3020e48883c3ac8e87d64baf1135c7
with:
unity-version: ${{ steps.env.outputs.unityVersion }}
unity-modules: ${{ matrix.unity-modules }}
- run: echo "::add-mask::${{ secrets.LICENSE_SERVER_URL }}"
- name: Create Unity license config
run: |
New-Item -Path '${{ matrix.unity-config-path }}' -ItemType Directory
Set-Content -Path '${{ matrix.unity-config-path }}services-config.json' -Value '${{ secrets.UNITY_LICENSE_SERVER_CONFIG }}'
- name: Download IntegrationTest project
uses: actions/download-artifact@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@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 "${{ 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