-
Notifications
You must be signed in to change notification settings - Fork 1
Add CI workflow to build and test on pull requests #41
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
Open
jskoiz
wants to merge
1
commit into
main
Choose a base branch
from
improvement/03-ci-workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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,64 @@ | ||
| name: CI | ||
|
|
||
| # Builds and tests Yemma4 on every PR and on pushes to main. | ||
| # Note: the build is heavy because it pulls the MLX dependencies (mlx-swift, | ||
| # mlx-swift-lm) and their transitive graph, so SwiftPM caches are used to avoid | ||
| # re-downloading and recompiling everything on every run. The package is | ||
| # iOS-only, so it must build/test against an iOS Simulator destination. | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Build & Test (iOS Simulator) | ||
| runs-on: macos-15 | ||
| timeout-minutes: 90 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Select latest Xcode | ||
| uses: maxim-lobanov/setup-xcode@v1 | ||
| with: | ||
| xcode-version: latest-stable | ||
|
|
||
| # Cache the heavy MLX dependency graph so we don't re-download/rebuild it | ||
| # on every run. Keyed on the resolved package graph. | ||
| - name: Cache SwiftPM | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/Library/Caches/org.swift.swiftpm | ||
| .build | ||
| key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-spm- | ||
|
|
||
| - name: Resolve dependencies | ||
| run: xcodebuild -resolvePackageDependencies -scheme Yemma4 | ||
|
|
||
| - name: Build & test (iOS Simulator) | ||
| run: | | ||
| set -o pipefail | ||
| xcodebuild test \ | ||
| -scheme Yemma4 \ | ||
| -destination 'platform=iOS Simulator,OS=latest,name=iPhone 16 Pro' \ | ||
| -skipPackagePluginValidation \ | ||
| -resultBundlePath TestResults \ | ||
| 2>&1 | ||
|
|
||
| - name: Upload test results | ||
| if: ${{ always() }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: TestResults | ||
| path: TestResults | ||
| if-no-files-found: ignore | ||
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.
This
xcodebuild teststep is wired to the currentYemma4scheme, but that scheme'sTestActionhas no testables andproject.pbxprojcontains only the appPBXNativeTarget(no XCTest/Swift Testing bundle). In this statexcodebuild testis not a valid CI action for the scheme, so every PR/push run will fail before proving the app builds; add a test target to the scheme or runxcodebuild builduntil tests exist.Useful? React with 👍 / 👎.