Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 51 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,58 @@
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: 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
xcodebuild test \
-project TOFileSystemObserverExample.xcodeproj \
-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
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results
path: TestResults.xcresult
Loading