Fix fastlane scan #207
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: Show Xcode version | |
| run: xcodebuild -version | |
| - 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 | |
| mkdir -p "$RESULTDIR" | |
| bundle exec fastlane scan \ | |
| scheme:"SnapSafe" \ | |
| result_bundle:true \ | |
| disable_concurrent_testing:true \ | |
| destination:"platform=iOS Simulator,name=iPhone 16,OS=18.0" \ | |
| output_directory:"$RESULTDIR" \ | |
| open_report:false | |
| - 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 |