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
117 changes: 117 additions & 0 deletions .github/workflows/stress-test-legacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Stress test legacy iOS harness
on:
pull_request:

jobs:
stress-test-ios-legacy:
runs-on: macos-latest
timeout-minutes: 120
env:
XCODE_VERSION: 16.4
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: Restore cocoapods
id: cocoapods-cache
uses: actions/cache/restore@v4
with:
path: |
**/ios/Pods
key: ${{ runner.os }}-legacy-cocoapods-${{ hashFiles('example/ios/Podfile', '*.podspec') }}
restore-keys: |
${{ runner.os }}-legacy-cocoapods-

- name: Install cocoapods
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
cd example
bundle install
USE_RIVE_LEGACY=1 bundle exec pod install --project-directory=ios

- name: Save cocoapods cache
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
**/ios/Pods
key: ${{ steps.cocoapods-cache.outputs.cache-key }}

- name: Restore iOS build cache
id: ios-build-cache
uses: actions/cache/restore@v4
with:
path: example/ios/build
key: ${{ runner.os }}-ios-legacy-build-${{ env.XCODE_VERSION }}-${{ hashFiles('yarn.lock', 'ios/**', 'nitrogen/generated/ios/**', '*.podspec', 'example/ios/Podfile', 'example/ios/RiveExample/**') }}
restore-keys: |
${{ runner.os }}-ios-legacy-build-${{ env.XCODE_VERSION }}-

- name: Build iOS app
if: steps.ios-build-cache.outputs.cache-hit != 'true'
working-directory: example/ios
run: |
set -o pipefail && xcodebuild \
-derivedDataPath build \
-workspace RiveExample.xcworkspace \
-scheme RiveExample \
-sdk iphonesimulator \
-configuration Debug \
build \
CODE_SIGNING_ALLOWED=NO

- name: Save iOS build cache
if: steps.ios-build-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: example/ios/build
key: ${{ steps.ios-build-cache.outputs.cache-primary-key }}

- name: Boot iOS Simulator
uses: futureware-tech/simulator-action@v4
with:
model: 'iPhone 16 Pro'
os_version: '18.6'

- 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 15
xcrun simctl list devices | grep Booted

- name: Stress test - run 20 iterations
working-directory: example
run: |
failures=0
for i in $(seq 1 20); do
echo "=== Iteration $i ==="
if yarn test:harness:ios --verbose --testTimeout 120000 2>&1 | tee /tmp/run-$i.log | tail -5; then
echo "Run $i: PASS"
else
failures=$((failures+1))
echo "Run $i: FAIL"
echo "--- Failed test details ---"
grep -E "FAIL|did not respond|Error" /tmp/run-$i.log | head -10
fi
echo ""
done
echo "=== RESULTS: $failures failures out of 20 ==="
if [ $failures -gt 0 ]; then
echo "::warning::$failures out of 20 runs failed"
fi

- name: Collect simulator logs on failure
if: failure()
run: |
echo "=== Last 10 minutes of simulator logs ==="
xcrun simctl spawn booted log show --predicate 'processImagePath CONTAINS "RiveExample"' --last 10m --style compact 2>&1 | tail -500 || echo "No logs found"
Loading