Fix fastlane scan #210
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 Build and Test | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| test: | |
| name: Run iOS Tests | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '26.0' | |
| - name: Use the exact SPM lockfile | |
| run: | | |
| # Ensure we use the committed lockfile, do not re-resolve | |
| xcodebuild -resolvePackageDependencies \ | |
| -project SnapSafe.xcodeproj \ | |
| -scheme SnapSafe | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| ruby-version: '3.4' | |
| - name: Install dependencies | |
| run: bundle install | |
| - name: Run tests (single destination, locked packages, unique xcresult) | |
| env: | |
| RESULTDIR: ${{ runner.temp }}/xcresult/${{ github.run_id }}-${{ github.run_attempt }}-$(date +%s) | |
| run: | | |
| set -o pipefail | |
| RESULTDIR="$RUNNER_TEMP/xcresult/$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT-$(date +%s)" | |
| mkdir -p "$RESULTDIR" | |
| xcodebuild \ | |
| -project SnapSafe.xcodeproj \ | |
| -scheme SnapSafe \ | |
| -destination "platform=iOS Simulator,name=iPhone 16,OS=18.6" \ | |
| -parallel-testing-enabled NO \ | |
| -skipMacroValidation \ | |
| -resultBundlePath "$RESULTDIR/SnapSafe.xcresult" \ | |
| build test | tee raw-xcodebuild.log | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: | | |
| fastlane/test_output/ | |
| fastlane/test_output/*.junit | |
| fastlane/test_output/*.html | |
| fastlane/test_output/*.xcresult | |
| retention-days: 30 | |
| - name: Publish test results | |
| if: always() | |
| uses: EnricoMi/publish-unit-test-result-action/macos@v2 | |
| with: | |
| files: | | |
| fastlane/test_output/*.junit | |
| check_name: iOS Test Results |