Skip to content

feat: support ResourceOption.InferenceDevice #76

feat: support ResourceOption.InferenceDevice

feat: support ResourceOption.InferenceDevice #76

Workflow file for this run

name: test
on:
workflow_dispatch:
push:
branches:
- "**"
paths:
- ".github/workflows/test.yml"
- "src/**"
- "*.sln"
- "*.props"
pull_request:
branches:
- "**"
paths:
- ".github/workflows/test.yml"
- "src/**"
- "*.sln"
- "*.props"
jobs:
test:
runs-on: macos-13
env:
API_LEVEL: 23
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages # NuGet CLI environment variables
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
8.0.x
cache: true
cache-dependency-path: '**/packages.lock.json'
- run: dotnet restore --locked-mode && dotnet build --no-restore
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ env.API_LEVEL }}
- name: Create AVD and generate snapshot for caching
if: ${{ !steps.avd-cache.outputs.cache-hit }}
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.API_LEVEL }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -no-metrics -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Test
uses: reactivecircus/android-emulator-runner@v2
timeout-minutes: 15
env:
AdbPath: adb
Address: emulator-5554
with:
api-level: ${{ env.API_LEVEL }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -no-metrics -camera-back none -no-snapshot-save
disable-animations: true
script: for i in {1..3}; do dotnet test --no-build --logger trx --verbosity normal && break; echo "Test run $i failed, retrying..."; done
- name: Upload TestResults
uses: actions/upload-artifact@v4
if: always()
with:
name: TestResults
path: |
./**/TestResults
./src/MaaFramework.Binding.UnitTests/bin/**/debug