From 9349378b8d02ab73cd11c2d930fa307ada40e842 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Sun, 14 Jun 2026 15:31:48 -0400 Subject: [PATCH] chore: add GitHub Actions test workflow - Run tests on iOS Simulator (iPhone 17 Pro) - Pin Xcode to version 26.5 - Use CI.xcconfig for simulator builds (no codesign) - Upload xcresult artifact for debugging - Fail build on test failure Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/test.yml | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b4f451c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,55 @@ +name: Run tests + +on: + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + test: + name: Run all tests on iOS + runs-on: macos-26 + timeout-minutes: 30 + + steps: + - name: Checkout current repository + uses: actions/checkout@v4 + + - name: Set Xcode version + run: | + sudo xcode-select -s /Applications/Xcode_26.5.app + + - name: Build for testing + run: | + xcodebuild build-for-testing \ + -project OpenAppLock.xcodeproj \ + -scheme OpenAppLock \ + -destination 'platform=iOS Simulator,name=iPhone 17 Pro' \ + -xcconfig Config/CI.xcconfig + + - name: Run tests + id: tests + continue-on-error: true + run: | + xcodebuild test-without-building \ + -project OpenAppLock.xcodeproj \ + -scheme OpenAppLock \ + -destination 'platform=iOS Simulator,name=iPhone 17 Pro' \ + -resultBundlePath ./output/test-result.xcresult \ + -xcconfig Config/CI.xcconfig + + - name: Compress test result + run: | + ditto -c -k --keepParent "output/test-result.xcresult" "output/test-result.zip" + + - name: Upload test result + uses: actions/upload-artifact@v4 + with: + name: test-result + path: output/test-result.zip + + - name: Check for test failure + if: steps.tests.outcome == 'failure' + run: | + echo "Tests failed. Check the uploaded artifacts for details." + exit 1