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
113 changes: 113 additions & 0 deletions .github/workflows/integration-build-test.yml
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"
Copy link

Copilot AI Nov 12, 2025

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.

Suggested change
MODULE: ":datetimepicker"
MODULE: ":datetimepicker"

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sdkmanager command uses || true to suppress errors, which could mask real installation failures. Additionally, the second command yes | sdkmanager --licenses || true will always succeed even if licenses fail to accept. Consider using proper error handling or at least logging the results:

run: |
  sdkmanager "platform-tools" \
             "platforms;android-34" \
             "build-tools;34.0.0"
  yes | sdkmanager --licenses

If you intentionally want to continue on errors, consider adding comments explaining why failures are acceptable.

Suggested change
"build-tools;34.0.0" || true
yes | sdkmanager --licenses || true
"build-tools;34.0.0"
yes | sdkmanager --licenses

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +51
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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 --licenses

If 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.

Suggested change
- 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.


# Android Build/Unit Test
- name: Gradle Build • Android
if: matrix.target == 'android'
uses: gradle/gradle-build-action@v3
with:
arguments: |
${{ env.MODULE }}:clean
${{ env.MODULE }}:assembleRelease
${{ env.MODULE }}:testReleaseUnitTest

# Web(WASM) Build/Test
- name: Gradle Build • Web (WASM)
if: matrix.target == 'wasm'
uses: gradle/gradle-build-action@v3
with:
arguments: |
${{ env.MODULE }}:clean
${{ env.MODULE }}:wasmJsBrowserDistribution
${{ env.MODULE }}:wasmJsTest

# Desktop(JVM) Build/Test
- name: Gradle Build • Desktop (JVM)
if: matrix.target == 'desktop'
uses: gradle/gradle-build-action@v3
with:
arguments: |
${{ env.MODULE }}:clean
${{ env.MODULE }}:desktopJar
${{ env.MODULE }}:desktopTest

ios-build-and-test:
name: macOS • iOS Simulator Test
runs-on: macos-14
timeout-minutes: 15
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'

- 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/')
Copy link

Copilot AI Nov 12, 2025

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.

Suggested change
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 uses AI. Check for mistakes.
echo "Using iOS runtime: $LATEST_IOS"
xcrun simctl create "CI-iPhone15" "iPhone 15" "$LATEST_IOS" || true
xcrun simctl boot "CI-iPhone15" || true
Comment on lines +103 to +104
Copy link

Copilot AI Nov 12, 2025

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
Suggested change
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

Copilot uses AI. Check for mistakes.
xcrun simctl list | head -n 50
Comment on lines +99 to +105
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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 50 looks 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.


# iOS Simulator Unit Test
- name: Gradle Build & Test • iOS
uses: gradle/gradle-build-action@v3
with:
arguments: |
${{ env.MODULE }}:clean
${{ env.MODULE }}:iosSimulatorArm64Test
Loading