name: iOS validation on: push: pull_request: workflow_dispatch: permissions: contents: read concurrency: group: ios-${{ github.ref }} cancel-in-progress: true jobs: simulator: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository runs-on: macos-arm64 timeout-minutes: 60 steps: - uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262 env: GIT_DEFAULT_HASH: sha256 with: persist-credentials: false - run: bash scripts/check-ci-runner.sh ios - name: Allocate isolated scratch space on the persistent Mac runner run: | scratch=$(mktemp -d "$RUNNER_TEMP/yuvomi-ios.XXXXXX") echo "YUVOMI_CI_TEMP=$scratch" >> "$GITHUB_ENV" - name: Install verified XcodeGen and generate project run: | bash scripts/install-xcodegen.sh "$YUVOMI_CI_TEMP/xcodegen" "$YUVOMI_CI_TEMP/xcodegen/xcodegen/bin/xcodegen" generate --spec ios/project.yml xcodebuild -version - name: Portable URL policy tests and Swift syntax run: | swift test --package-path ios --scratch-path "$YUVOMI_CI_TEMP/SwiftPolicy" swiftc -frontend -parse ios/Sources/*.swift ios/Tests/*.swift ios/UITests/*.swift - name: Simulator build and XCTest (no production signing) run: | device=$(python3 scripts/select-simulator.py) xcodebuild -project ios/Yuvomi.xcodeproj -scheme Yuvomi -destination "platform=iOS Simulator,id=$device" -derivedDataPath "$YUVOMI_CI_TEMP/DerivedData" -resultBundlePath "$YUVOMI_CI_TEMP/Simulator.xcresult" CODE_SIGNING_ALLOWED=NO test - name: Unsigned device archive validation run: xcodebuild -project ios/Yuvomi.xcodeproj -scheme Yuvomi -destination 'generic/platform=iOS' -derivedDataPath "$YUVOMI_CI_TEMP/DerivedData" -archivePath "$YUVOMI_CI_TEMP/Yuvomi-unsigned.xcarchive" CODE_SIGNING_ALLOWED=NO archive - uses: https://gitea.com/actions/upload-artifact@c6a3b2bd78b3985e4b2f15397fec357f0fd808de if: always() && env.YUVOMI_CI_TEMP != '' with: name: ios-unsigned-archive-and-test-results path: | ${{ env.YUVOMI_CI_TEMP }}/Simulator.xcresult ${{ env.YUVOMI_CI_TEMP }}/Yuvomi-unsigned.xcarchive retention-days: 14 - name: Remove only this job's allocated scratch directory if: always() run: | case "${YUVOMI_CI_TEMP:-}" in "$RUNNER_TEMP"/yuvomi-ios.*) rm -rf -- "$YUVOMI_CI_TEMP" ;; esac