Fix fastlane scan #211
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 ruby dependencies for fastlane | |
| run: bundle install | |
| - name: Run tests | |
| 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" | |
| bundle exec fastlane scan \ | |
| scheme:"SnapSafe" \ | |
| destination:"platform=iOS Simulator,name=iPhone 16,OS=18.6" \ | |
| xcargs:"-skipMacroValidation" \ | |
| result_bundle:true \ | |
| disable_concurrent_testing:true \ | |
| derived_data_path:"$RUNNER_TEMP/DerivedData" \ | |
| buildlog_path:"fastlane/test_output" \ | |
| 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 |