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
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
Loading