-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add CI configuration for building and testing CMP #21
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
Changes from all commits
e2b22c9
207373b
8839048
c26a280
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,113 @@ | ||||||||||||||||||||||||||||||||||||||
| name: CI - Compose Multiplatform TimePicker (Build & Test) | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||
| branches: [ main ] | ||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||
| branches: [ main ] | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| concurrency: | ||||||||||||||||||||||||||||||||||||||
| group: ${{ github.workflow }}-${{ github.ref }} | ||||||||||||||||||||||||||||||||||||||
| cancel-in-progress: true | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||
| MODULE: ":datetimepicker" | ||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| linux-builds: | ||||||||||||||||||||||||||||||||||||||
| name: Linux • ${{ matrix.target }} | ||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 15 | ||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||||||
| target: [ android, wasm, desktop ] | ||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - uses: gradle/wrapper-validation-action@v2 | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Set up JDK 17 | ||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-java@v4 | ||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||
| java-version: '17' | ||||||||||||||||||||||||||||||||||||||
| distribution: 'temurin' | ||||||||||||||||||||||||||||||||||||||
| cache: 'gradle' | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| # Android Set Up | ||||||||||||||||||||||||||||||||||||||
| - name: Set up Android SDK | ||||||||||||||||||||||||||||||||||||||
| if: matrix.target == 'android' | ||||||||||||||||||||||||||||||||||||||
| uses: android-actions/setup-android@v3 | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Install Android build tools | ||||||||||||||||||||||||||||||||||||||
| if: matrix.target == 'android' | ||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||
| sdkmanager "platform-tools" \ | ||||||||||||||||||||||||||||||||||||||
| "platforms;android-34" \ | ||||||||||||||||||||||||||||||||||||||
| "build-tools;34.0.0" || true | ||||||||||||||||||||||||||||||||||||||
| yes | sdkmanager --licenses || true | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+50
to
+51
|
||||||||||||||||||||||||||||||||||||||
| "build-tools;34.0.0" || true | |
| yes | sdkmanager --licenses || true | |
| "build-tools;34.0.0" | |
| yes | sdkmanager --licenses |
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.
Remove error suppression from critical SDK setup commands.
The || true patterns on lines 50–51 mask failures in SDK installation and license acceptance, allowing the workflow to proceed with incomplete or failed setup. This defeats CI safety guarantees.
Replace these commands with explicit error handling, or remove || true to fail fast on problems:
- name: Install Android build tools
if: matrix.target == 'android'
run: |
- sdkmanager "platform-tools" \
- "platforms;android-34" \
- "build-tools;34.0.0" || true
- yes | sdkmanager --licenses || true
+ sdkmanager "platform-tools" \
+ "platforms;android-34" \
+ "build-tools;34.0.0"
+ yes | sdkmanager --licensesIf occasional transient failures are expected, use a retry mechanism (e.g., retry action or script-level backoff) instead of silently ignoring all errors.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Install Android build tools | |
| if: matrix.target == 'android' | |
| run: | | |
| sdkmanager "platform-tools" \ | |
| "platforms;android-34" \ | |
| "build-tools;34.0.0" || true | |
| yes | sdkmanager --licenses || true | |
| - name: Install Android build tools | |
| if: matrix.target == 'android' | |
| run: | | |
| sdkmanager "platform-tools" \ | |
| "platforms;android-34" \ | |
| "build-tools;34.0.0" | |
| yes | sdkmanager --licenses |
🤖 Prompt for AI Agents
.github/workflows/integration-build-test.yml around lines 45 to 51: the SDK
installation and license acceptance lines silently swallow errors with `||
true`; remove the `|| true` suffixes so failures cause the job to fail fast, and
replace with a simple retry wrapper if transient failures are expected (e.g., a
small shell loop that retries sdkmanager commands N times with sleep/backoff and
exits non-zero on final failure) or use a dedicated retry action; also ensure
the `yes | sdkmanager --licenses` command is allowed to surface errors rather
than being forced to succeed.
Copilot
AI
Nov 12, 2025
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 iOS runtime extraction logic may be fragile. The sed command expects a specific format and the extracted runtime string may not match what xcrun simctl expects. Consider using a more robust approach:
LATEST_IOS=$(xcrun simctl list runtimes | grep "iOS" | tail -n 1 | awk '{print $NF}')
echo "Using iOS runtime: $LATEST_IOS"Or use a specific iOS version to ensure consistency across CI runs.
| LATEST_IOS=$(xcrun simctl list runtimes | grep "iOS" | tail -n 1 | sed -E 's/.*iOS ([0-9]+\.[0-9]+).*/iOS \1/') | |
| LATEST_IOS=$(xcrun simctl list runtimes | grep "iOS" | tail -n 1 | awk '{print $NF}') |
Copilot
AI
Nov 12, 2025
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.
Using || true to suppress errors when creating and booting the simulator could hide actual failures. If the simulator fails to boot, the iOS tests will fail anyway but without clear diagnostic information. Consider checking the exit status and providing better error messages:
if ! xcrun simctl create "CI-iPhone15" "iPhone 15" "$LATEST_IOS"; then
echo "Simulator already exists or creation failed"
fi
if ! xcrun simctl boot "CI-iPhone15"; then
echo "Simulator already booted or boot failed"
fi| xcrun simctl create "CI-iPhone15" "iPhone 15" "$LATEST_IOS" || true | |
| xcrun simctl boot "CI-iPhone15" || true | |
| if ! xcrun simctl create "CI-iPhone15" "iPhone 15" "$LATEST_IOS"; then | |
| echo "Simulator already exists or creation failed" | |
| fi | |
| if ! xcrun simctl boot "CI-iPhone15"; then | |
| echo "Simulator already booted or boot failed" | |
| fi |
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.
Validate iOS simulator setup and remove error suppression.
The iOS simulator boot sequence masks failures with || true (lines 103–104) and uses fragile regex parsing (line 101) that could fail silently. Additionally, line 105 appears to be debugging output.
Issues:
- If simulator creation or boot fails, tests will still run, likely against stale or missing simulator state, causing cryptic failures later.
- The regex parsing
sed -E 's/.*iOS ([0-9]+\.[0-9]+).*/iOS \1/'breaks if xcrun output format changes. - No validation that simulator boot actually succeeded before proceeding to tests.
- Line 105
xcrun simctl list | head -n 50looks like debug output.
Suggested improvements:
- name: Boot iOS Simulator (iPhone 15)
run: |
LATEST_IOS=$(xcrun simctl list runtimes | grep "iOS" | tail -n 1 | sed -E 's/.*iOS ([0-9]+\.[0-9]+).*/iOS \1/')
echo "Using iOS runtime: $LATEST_IOS"
- xcrun simctl create "CI-iPhone15" "iPhone 15" "$LATEST_IOS" || true
- xcrun simctl boot "CI-iPhone15" || true
- xcrun simctl list | head -n 50
+ xcrun simctl create "CI-iPhone15" "iPhone 15" "$LATEST_IOS" || xcrun simctl delete "CI-iPhone15" 2>/dev/null || true
+ xcrun simctl boot "CI-iPhone15"
+ # Verify simulator is booted
+ sleep 2
+ xcrun simctl list | grep "CI-iPhone15" | grep "(Booted)" || (echo "Simulator failed to boot" && exit 1)Alternatively, consider using a well-maintained action like futureware-tech/simulator-action or similar to abstract this complexity.
🤖 Prompt for AI Agents
.github/workflows/integration-build-test.yml around lines 99 to 105: the current
steps suppress failures with "|| true", use a fragile sed regex to pick the
latest iOS runtime, and leave a debug list command; update the job to (1) fail
the run instead of swallowing errors (remove "|| true"), (2) select the runtime
robustly by parsing JSON from `xcrun simctl list runtimes --json` (or validate
the extracted runtime exists), (3) after creating and booting the simulator
check its state in a retry loop with a timeout and exit non‑zero if it never
reaches "Booted", and (4) remove or gate the `xcrun simctl list | head -n 50`
debug output; alternatively replace the whole sequence with a maintained GitHub
Action such as futureware‑tech/simulator-action to handle creation, boot and
validation.
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.
[nitpick] Missing newline after the environment variable declaration. For better YAML readability and consistency, add a blank line after line 17 before the
jobs:section.