Skip to content
Open
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
62 changes: 45 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
ktlint_version: "1.5.0"
ktlint_version: '1.5.0'
android: true

lint:
Expand Down Expand Up @@ -136,15 +136,15 @@ jobs:

- name: Build example for Android
env:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
JAVA_OPTS: '-XX:MaxHeapSize=6g'
TURBO_FORCE: ${{ steps.turbo-cache-android.outputs.cache-hit != 'true' }}
run: |
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"

build-ios:
runs-on: macos-latest
runs-on: ghcr.io/cirruslabs/macos-runner:sonoma
env:
XCODE_VERSION: 16.4
XCODE_VERSION: 16.1
TURBO_CACHE_DIR: .turbo/ios
steps:
- name: Checkout
Expand All @@ -170,11 +170,10 @@ jobs:
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Use appropriate Xcode version
- name: Select Xcode version
if: env.turbo_cache_hit != 1
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
run: |
xcodes select ${{ env.XCODE_VERSION }}

- name: Restore cocoapods
if: env.turbo_cache_hit != 1
Expand Down Expand Up @@ -209,21 +208,19 @@ jobs:
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"

test-harness-ios:
if: false # TODO: re-enable once harness timeout issues are resolved
runs-on: macos-latest
runs-on: ghcr.io/cirruslabs/macos-runner:sonoma
env:
XCODE_VERSION: 16.4
XCODE_VERSION: 16.1
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Use appropriate Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
- name: Select Xcode version
run: |
xcodes select ${{ env.XCODE_VERSION }}

- name: Restore cocoapods
id: cocoapods-cache
Expand Down Expand Up @@ -258,11 +255,42 @@ jobs:
uses: futureware-tech/simulator-action@v4
with:
model: 'iPhone 16 Pro'
os_version: '18.6'
os_version: '18.1'

- name: Install app on simulator
run: xcrun simctl install booted example/ios/build/Build/Products/Debug-iphonesimulator/RiveExample.app

- name: Wait for simulator to be fully ready
run: |
echo "Waiting for simulator to be fully ready..."
sleep 10
xcrun simctl list devices | grep Booted

- name: Run harness tests on iOS
working-directory: example
run: yarn test:harness:ios --debug --verbose --testTimeout 120000
run: |
# Retry up to 3 times due to flaky harness connection
for attempt in 1 2 3; do
echo "=== Attempt $attempt of 3 ==="
set +e
yarn test:harness:ios --verbose --testTimeout 120000
exit_code=$?
set -e

echo "Exit code: $exit_code"

if [ $exit_code -eq 0 ]; then
echo "Tests passed on attempt $attempt"
exit 0
fi
echo "Attempt $attempt failed, retrying..."
sleep 5
done
echo "All 3 attempts failed"
exit 1

- name: Debug - Check for console logs
if: failure()
run: |
echo "=== Checking simulator logs for errors ==="
xcrun simctl spawn booted log show --predicate 'processImagePath CONTAINS "RiveExample"' --last 5m --style compact 2>&1 | tail -200 || echo "No logs found"
Loading