-
Notifications
You must be signed in to change notification settings - Fork 1
ci: add unit test workflow #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
135bfbc
ci: add GitHub Actions workflow to run unit tests on PRs
torlando-tech 3f7bbf2
ci: disable code signing for CI test builds
torlando-tech 0362f96
ci: auto-detect Xcode version and simulator destination
torlando-tech 2ec5425
ci: dynamically find available iPhone simulator for test runs
torlando-tech 9cf36cf
ci: use ad-hoc signing for CI builds
torlando-tech b7fd2cd
ci: split into build-for-testing and test-without-building steps
torlando-tech 514baaf
ci: add verbose build logging to diagnose ColumbaApp compilation failure
torlando-tech 548553d
ci: explicitly build app target before running tests
torlando-tech 308a400
ci: fix -target and -scheme conflict in build step
torlando-tech 3c1ce4f
ci: build app with scheme first, then run tests separately
torlando-tech File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: macos-15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Clone sibling packages | ||
| run: | | ||
| git clone https://github.com/torlando-tech/reticulum-swift.git ../reticulum-swift | ||
| git clone https://github.com/torlando-tech/LXMF-swift.git ../LXMF-swift | ||
| git clone https://github.com/torlando-tech/LXST-swift.git ../LXST-swift | ||
|
|
||
| - name: Select Xcode | ||
| run: | | ||
| XCODE=$(ls -d /Applications/Xcode_16*.app 2>/dev/null | sort -V | tail -1) | ||
| echo "Using $XCODE" | ||
| sudo xcode-select -s "$XCODE" | ||
| xcodebuild -version | ||
|
|
||
| - name: Find simulator | ||
| id: sim | ||
| run: | | ||
| DEVICE_ID=$(xcrun simctl list devices available -j \ | ||
| | python3 -c "import sys,json; devs=json.load(sys.stdin)['devices']; print(next(d['udid'] for rt in devs for d in devs[rt] if 'iPhone' in d['name']))") | ||
| echo "device_id=$DEVICE_ID" >> "$GITHUB_OUTPUT" | ||
| echo "Using simulator: $DEVICE_ID" | ||
|
|
||
| - name: Build | ||
| run: | | ||
| xcodebuild build \ | ||
| -project ColumbaApp.xcodeproj \ | ||
| -scheme ColumbaApp \ | ||
| -sdk iphonesimulator \ | ||
| -destination "id=${{ steps.sim.outputs.device_id }}" \ | ||
| CODE_SIGN_IDENTITY=- \ | ||
| CODE_SIGNING_REQUIRED=NO \ | ||
| CODE_SIGNING_ALLOWED=YES \ | ||
| DEVELOPMENT_TEAM="" \ | ||
| PROVISIONING_PROFILE_SPECIFIER="" | ||
|
|
||
| - name: Build and run tests | ||
| run: | | ||
| xcodebuild test \ | ||
| -project ColumbaApp.xcodeproj \ | ||
| -scheme ColumbaApp \ | ||
| -sdk iphonesimulator \ | ||
| -destination "id=${{ steps.sim.outputs.device_id }}" \ | ||
| -only-testing:ColumbaAppTests \ | ||
| -resultBundlePath TestResults.xcresult \ | ||
| CODE_SIGN_IDENTITY=- \ | ||
| CODE_SIGNING_REQUIRED=NO \ | ||
| CODE_SIGNING_ALLOWED=YES \ | ||
| DEVELOPMENT_TEAM="" \ | ||
| PROVISIONING_PROFILE_SPECIFIER="" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The three sibling repos are cloned without specifying a branch, tag, or commit SHA, so every CI run always uses the latest HEAD of each package's default branch. If someone pushes a breaking change to
reticulum-swift,LXMF-swift, orLXST-swift, this workflow will start failing even though nothing incolumba-ioschanged, making it hard to tell whether the failure is local or upstream.Consider pinning to a specific branch or ref so the build is reproducible and failures are attributable:
Or, if full reproducibility is needed, add a step that resolves and records the HEAD SHAs of each sibling so failed runs can be replicated exactly.