From 8427f6425d91b612fede94d0305eee9857ff19b6 Mon Sep 17 00:00:00 2001 From: Tim Oliver Date: Wed, 6 May 2026 14:38:28 +0900 Subject: [PATCH 1/2] Update CI script for latest macOS and Xcode --- .github/workflows/ci.yml | 50 +++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4135931..ca23001 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,49 @@ name: CI -on: [push] +on: + push: + pull_request: jobs: - build: - + test: + name: iOS Simulator Tests runs-on: macos-latest steps: - - uses: actions/checkout@v1 - - name: Run all of the library unit tests. - run: '(curl -s -L https://tim.dev/install_ios_oss_ci | bash -s arg1 arg2) && bundle exec fastlane test' - env: - TEST_SCHEME: "TOFileSystemObserverTests" + - uses: actions/checkout@v4 + + - name: Show Xcode and SDK versions + run: | + xcodebuild -version + xcrun --show-sdk-version --sdk iphonesimulator + + - name: Select latest iPhone simulator + id: simulator + run: | + DEVICE=$(xcrun simctl list devices available | \ + grep -oE 'iPhone [0-9]+( Pro( Max)?)?' | \ + sort -V | tail -n 1) + if [ -z "$DEVICE" ]; then + echo "No iPhone simulator found. Available devices:" + xcrun simctl list devices available + exit 1 + fi + echo "Selected simulator: $DEVICE" + echo "device=$DEVICE" >> "$GITHUB_OUTPUT" + + - name: Run tests + run: | + set -o pipefail + xcodebuild test \ + -project TOFileSystemObserverExample.xcodeproj \ + -scheme TOFileSystemObserverTests \ + -destination "platform=iOS Simulator,name=${{ steps.simulator.outputs.device }},OS=latest" \ + -resultBundlePath TestResults.xcresult \ + CODE_SIGNING_ALLOWED=NO + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: test-results + path: TestResults.xcresult From 6b8294fe1044667c93bc1a31e12ddd6beb7031cf Mon Sep 17 00:00:00 2001 From: Tim Oliver Date: Wed, 6 May 2026 16:51:27 +0900 Subject: [PATCH 2/2] Increased timeout for NSFilePresenter tests --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca23001..d77d39b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,13 @@ jobs: echo "Selected simulator: $DEVICE" echo "device=$DEVICE" >> "$GITHUB_OUTPUT" + - name: Pre-boot simulator + # Cold-boot the simulator before running tests so file-coordination and + # presenter system services are ready by the time NSFilePresenter-driven + # integration tests start. Skipping this makes those tests flake on CI + # even though they pass reliably locally. + run: xcrun simctl bootstatus "${{ steps.simulator.outputs.device }}" -b + - name: Run tests run: | set -o pipefail @@ -39,6 +46,8 @@ jobs: -scheme TOFileSystemObserverTests \ -destination "platform=iOS Simulator,name=${{ steps.simulator.outputs.device }},OS=latest" \ -resultBundlePath TestResults.xcresult \ + -test-iterations 3 \ + -retry-tests-on-failure \ CODE_SIGNING_ALLOWED=NO - name: Upload test results