Repository navigation
fix(release): walk the CI check back to the last change it covers #2454
Workflow file for this run
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 and Package Tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main, 'release/**'] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ios-tests-${{ github.event_name == 'pull_request' && github.ref || github.sha }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| changes: | |
| name: Changes (iOS) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| outputs: | |
| run: ${{ steps.decide.outputs.run }} | |
| oracle: ${{ steps.decide.outputs.oracle }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Decide which suites run | |
| id: decide | |
| env: | |
| BASE: ${{ github.event.pull_request.base.sha || github.event.before }} | |
| run: | | |
| set -euo pipefail | |
| run=$(scripts/ci/detect-changed-paths.sh --base "$BASE" ios) | |
| oracle=$(scripts/ci/detect-changed-paths.sh --base "$BASE" oracle) | |
| { echo "run=$run"; echo "oracle=$oracle"; } >> "$GITHUB_OUTPUT" | |
| # The required check, with no gate job: see macos-tests.yml. TableProCore and TableProOracle run | |
| # here under swift test, never in an Xcode test plan: a plan target that depends on the package | |
| # TableProPluginKit makes the app and plugins compile against its module, not the framework. | |
| ios: | |
| name: iOS and Package Tests | |
| needs: changes | |
| if: ${{ !cancelled() && needs.changes.outputs.run != 'false' }} | |
| runs-on: xcode-27 | |
| timeout-minutes: 50 | |
| env: | |
| DESTINATION: platform=iOS Simulator,name=iPhone 18 Pro | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/setup-xcode | |
| - uses: ./.github/actions/setup-xcodegen | |
| - name: Download static libraries | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: scripts/download-libs.sh | |
| - name: Generate the Xcode project | |
| run: scripts/generate-project.sh ios | |
| # The image ships the iOS 27.0 runtime. Downloading the one for Xcode's newer SDK costs minutes. | |
| - name: Make sure the simulator exists | |
| run: | | |
| if ! xcrun simctl list devices available | grep -F "iPhone 18 Pro (" > /dev/null; then | |
| sudo xcodebuild -downloadPlatform iOS | |
| fi | |
| # One simulator, not clones: on a 3-core runner a second booted simulator killed runs with | |
| # "(ipc/mig) server died", and TableProMobileTests is one bundle that never split anyway. | |
| - name: Run the iOS tests | |
| run: | | |
| set -o pipefail | |
| xcodebuild test \ | |
| -project TableProMobile/TableProMobile.xcodeproj -scheme TableProMobile \ | |
| -destination "$DESTINATION" -only-testing:TableProMobileTests \ | |
| -parallel-testing-enabled NO \ | |
| -skipPackagePluginValidation -resultBundlePath iOS.xcresult \ | |
| CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO \ | |
| | xcbeautify --renderer github-actions | |
| # --parallel is what makes swift test write the XCTest xunit file. Without it only the Swift | |
| # Testing one appears, and TableProOracle's cases are all XCTest. | |
| - name: Run the TableProCore package tests | |
| if: ${{ !cancelled() }} | |
| run: swift test --package-path Packages/TableProCore --parallel --xunit-output Core.xml | |
| # Pinned to the tracked Package.resolved, so a manifest bump that forgets the lockfile fails. | |
| - name: Run the TableProOracle package tests | |
| if: ${{ !cancelled() && needs.changes.outputs.oracle != 'false' }} | |
| run: swift test --package-path Packages/TableProOracle --force-resolved-versions --parallel --xunit-output Oracle.xml | |
| # Fails the job when a bundle or a package ran zero tests, which both tools report as success. | |
| - name: Summarize the results | |
| if: ${{ !cancelled() }} | |
| run: scripts/ci/summarize-xcresult.sh iOS.xcresult Core.xml Oracle.xml | |
| - name: Upload the result bundle | |
| if: ${{ failure() }} | |
| continue-on-error: true | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: ios-tests-${{ github.run_attempt }} | |
| path: iOS.xcresult | |
| if-no-files-found: ignore | |
| retention-days: 7 |