Skip to content

Commit

Permalink
Update github actions (#1985)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjohnsonpint authored Oct 28, 2022
1 parent 6434a5a commit ff194db
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .github/actions/buildnative/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ runs:
run: echo "JAVA_HOME_11=$JAVA_HOME_11_X64" >> $GITHUB_ENV

- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
shell: bash
run: ${{ runner.os == 'macOS' && 'brew install ninja' || runner.os == 'Windows' && 'choco install ninja' || 'sudo apt-get install ninja-build' }}

- name: Build C Project
if: runner.os == 'Linux' || runner.os == 'macOS'
Expand Down
3 changes: 0 additions & 3 deletions .github/actions/environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ runs:
- name: Install .NET 6 SDK
uses: actions/setup-dotnet@v3
if: runner.os == 'Windows'
env:
# Prevent setup-dotnet action from stepping on pre-installed dotnet SDKs
DOTNET_INSTALL_DIR: C:\Program Files\dotnet
with:
dotnet-version: 6.x.x

Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/device-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ jobs:
android:
needs: [build]
name: Run Android API-${{ matrix.api-level }} Test
runs-on: macos-latest # MacOS is required for the emulator, per https://github.com/ReactiveCircus/android-emulator-runner/blob/main/README.md
# MacOS is required for the emulator, per https://github.com/ReactiveCircus/android-emulator-runner/blob/main/README.md
# We use macos-12 because macos-latest will soon point there anyway, per https://github.com/actions/runner-images/issues/6384
runs-on: macos-12
strategy:
fail-fast: false
matrix:
Expand All @@ -59,27 +61,30 @@ jobs:
name: device-test-android
path: bin

- name: Install xharness
- name: Install XHarness
run: dotnet tool install Microsoft.DotNet.XHarness.CLI --global --version "1.*-*"

# Cached AVD setup per https://github.com/ReactiveCircus/android-emulator-runner/blob/main/README.md
- name: Install Intel HAXM
run: brew install --cask intel-haxm

- name: Gradle cache
- name: Setup Gradle
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef # pin@v2

# Cached AVD setup per https://github.com/ReactiveCircus/android-emulator-runner/blob/main/README.md

- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
key: avd-hwaccel-${{ matrix.api-level }}

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
timeout-minutes: 30
uses: reactivecircus/android-emulator-runner@d7b53ddc6e44254e1f4cf4a6ad67345837027a66 # pin@v2
uses: reactivecircus/android-emulator-runner@50986b1464923454c95e261820bc626f38490ec0 # pin@v2
with:
api-level: ${{ matrix.api-level }}
# We don't need the Google APIs, but the default images are not available for 32+
Expand All @@ -88,13 +93,13 @@ jobs:
ram-size: 2048M
arch: x86_64
disk-size: 4096M
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
emulator-options: -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Run Tests
timeout-minutes: 30
uses: reactivecircus/android-emulator-runner@d7b53ddc6e44254e1f4cf4a6ad67345837027a66 # pin@v2
uses: reactivecircus/android-emulator-runner@50986b1464923454c95e261820bc626f38490ec0 # pin@v2
with:
api-level: ${{ matrix.api-level }}
# We don't need the Google APIs, but the default images are not available for 32+
Expand All @@ -103,7 +108,7 @@ jobs:
ram-size: 2048M
arch: x86_64
disk-size: 4096M
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
emulator-options: -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: xharness android test --output-directory=./test_output --app=bin/io.sentry.dotnet.maui.device.testapp-Signed.apk --package-name=io.sentry.dotnet.maui.device.testapp

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vulnerabilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

# We only need to restore to check for vulnerable packages
- name: Restore .NET Dependencies
run: dotnet restore --nologo
run: dotnet restore Sentry-CI-Build-${{ runner.os }}.slnf --nologo

# The dotnet list package command doesn't change its exit code on detection, so tee to a file and scan it
# See https://github.com/NuGet/Home/issues/11315#issuecomment-1243055173
Expand Down

0 comments on commit ff194db

Please sign in to comment.