iOS Stress Tests #145
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: iOS Stress Tests | |
| on: | |
| schedule: | |
| - cron: '30 3 * * *' | |
| workflow_dispatch: | |
| env: | |
| XCODE_VERSION: '16.4' | |
| permissions: | |
| contents: read | |
| issues: write | |
| jobs: | |
| stress-tests: | |
| name: Stress Tests | |
| runs-on: macos-15 | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@ad2b38190b15e4d6bdf0c97fb4fca8412226d287 # v5.3.0 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@cf4beec8b4cca436a7b646657f74edc125658df8 # v6.1.1 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app | |
| - name: Prepare iOS Simulator | |
| id: sim | |
| uses: ./.github/actions/prepare-ios-simulator | |
| with: | |
| boot: 'true' | |
| - name: Cache Kotlin/Native toolchain | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: ~/.konan | |
| key: konan-${{ runner.os }}-${{ hashFiles('gradle/libs.versions.toml') }} | |
| - name: Build shared framework | |
| run: ./gradlew :shared:linkDebugFrameworkIosSimulatorArm64 | |
| - name: Cache ONNX Runtime xcframework | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: iosApp/Frameworks | |
| key: onnxruntime-${{ hashFiles('iosApp/setup_onnxruntime.sh') }} | |
| - name: Download ONNX Runtime | |
| run: bash iosApp/setup_onnxruntime.sh | |
| - name: Run stress tests | |
| env: | |
| RUN_STRESS_TESTS: "1" | |
| run: | | |
| xcodebuild test \ | |
| -project iosApp/UkuleleCompanion.xcodeproj \ | |
| -scheme UkuleleCompanion \ | |
| -destination "id=${{ steps.sim.outputs.udid }}" \ | |
| -configuration Debug \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| -only-testing:UkuleleCompanionUITests \ | |
| -resultBundlePath StressTestResults | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ios-stress-test-results | |
| path: StressTestResults.xcresult | |
| - name: Upload crash logs | |
| if: failure() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ios-crash-logs | |
| path: ~/Library/Logs/DiagnosticReports/UkuleleCompanion* | |
| - name: File issue on scheduled failure | |
| if: failure() && github.event_name == 'schedule' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| EXISTING=$(gh issue list --label ci-failure --state open \ | |
| --search "in:title ${{ github.workflow }}" --json number -q '.[0].number') | |
| if [ -n "$EXISTING" ]; then | |
| gh issue comment "$EXISTING" --body "Still failing: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| else | |
| gh issue create \ | |
| --title "Nightly failure: ${{ github.workflow }}" \ | |
| --label "ci-failure,bug" \ | |
| --body "Scheduled run failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} — check the uploaded artifacts (crash inputs / xcresult bundles) before they expire." | |
| fi | |
| tsan-tests: | |
| name: Thread Sanitizer | |
| runs-on: macos-15 | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@ad2b38190b15e4d6bdf0c97fb4fca8412226d287 # v5.3.0 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@cf4beec8b4cca436a7b646657f74edc125658df8 # v6.1.1 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app | |
| - name: Prepare iOS Simulator | |
| id: sim | |
| uses: ./.github/actions/prepare-ios-simulator | |
| with: | |
| boot: 'true' | |
| - name: Cache Kotlin/Native toolchain | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: ~/.konan | |
| key: konan-${{ runner.os }}-${{ hashFiles('gradle/libs.versions.toml') }} | |
| - name: Build shared framework | |
| run: ./gradlew :shared:linkDebugFrameworkIosSimulatorArm64 | |
| - name: Cache ONNX Runtime xcframework | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: iosApp/Frameworks | |
| key: onnxruntime-${{ hashFiles('iosApp/setup_onnxruntime.sh') }} | |
| - name: Download ONNX Runtime | |
| run: bash iosApp/setup_onnxruntime.sh | |
| - name: Run tests with Thread Sanitizer | |
| env: | |
| RUN_STRESS_TESTS: "1" | |
| run: | | |
| xcodebuild test \ | |
| -project iosApp/UkuleleCompanion.xcodeproj \ | |
| -scheme UkuleleCompanion \ | |
| -destination "id=${{ steps.sim.outputs.udid }}" \ | |
| -configuration Debug \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| -enableThreadSanitizer YES \ | |
| -only-testing:UkuleleCompanionUITests \ | |
| -resultBundlePath TSanResults | |
| - name: Upload TSan results | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ios-tsan-results | |
| path: TSanResults.xcresult | |
| - name: Upload TSan crash logs | |
| if: failure() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ios-tsan-crash-logs | |
| path: ~/Library/Logs/DiagnosticReports/UkuleleCompanion* | |
| - name: File issue on scheduled failure | |
| if: failure() && github.event_name == 'schedule' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| EXISTING=$(gh issue list --label ci-failure --state open \ | |
| --search "in:title ${{ github.workflow }}" --json number -q '.[0].number') | |
| if [ -n "$EXISTING" ]; then | |
| gh issue comment "$EXISTING" --body "Still failing: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| else | |
| gh issue create \ | |
| --title "Nightly failure: ${{ github.workflow }}" \ | |
| --label "ci-failure,bug" \ | |
| --body "Scheduled run failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} — check the uploaded artifacts (crash inputs / xcresult bundles) before they expire." | |
| fi |