Repository navigation
Size CSS border-radius by the CSS box model (#5454) #5247
Workflow file for this run
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
| --- | |
| name: Test Android build scripts | |
| 'on': | |
| # Manual dispatch: this PR's changed-file count exceeds GitHub's paths-filter | |
| # diff limit, so pull_request triggers stopped firing -- dispatch with | |
| # gh workflow run <file> --ref <branch> | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '5 1 * * *' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/scripts-android.yml' | |
| - 'scripts/setup-workspace.sh' | |
| - 'scripts/build-android-port.sh' | |
| - 'scripts/build-android-app.sh' | |
| - 'scripts/run-android-instrumentation-tests.sh' | |
| - 'scripts/generate-android-coverage-report.sh' | |
| - 'scripts/android/lib/**/*.java' | |
| - 'scripts/android/tests/**/*.java' | |
| - 'scripts/device-runner-app/**/*.java' | |
| - 'scripts/hellocodenameone/**' | |
| - 'scripts/android/screenshots/**' | |
| - '!scripts/android/screenshots/**/*.md' | |
| - 'scripts/templates/**' | |
| - '!scripts/templates/**/*.md' | |
| - 'CodenameOne/src/**' | |
| - '!CodenameOne/src/**/*.md' | |
| - 'Ports/Android/**' | |
| - '!Ports/Android/**/*.md' | |
| - 'native-themes/android-material/**' | |
| - '!native-themes/android-material/**/*.md' | |
| - 'maven/**' | |
| - '!maven/core-unittests/**' | |
| - 'tests/**' | |
| - '!tests/**/*.md' | |
| - '!docs/**' | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - '.github/workflows/scripts-android.yml' | |
| - 'scripts/setup-workspace.sh' | |
| - 'scripts/build-android-port.sh' | |
| - 'scripts/build-android-app.sh' | |
| - 'scripts/run-android-instrumentation-tests.sh' | |
| - 'scripts/generate-android-coverage-report.sh' | |
| - 'scripts/android/lib/**/*.java' | |
| - 'scripts/android/tests/**/*.java' | |
| - 'scripts/device-runner-app/**/*.java' | |
| - 'scripts/hellocodenameone/**' | |
| - 'scripts/android/screenshots/**' | |
| - '!scripts/android/screenshots/**/*.md' | |
| - 'scripts/templates/**' | |
| - '!scripts/templates/**/*.md' | |
| - 'CodenameOne/src/**' | |
| - '!CodenameOne/src/**/*.md' | |
| - 'Ports/Android/**' | |
| - '!Ports/Android/**/*.md' | |
| - 'native-themes/android-material/**' | |
| - '!native-themes/android-material/**/*.md' | |
| - 'maven/**' | |
| - '!maven/core-unittests/**' | |
| - 'tests/**' | |
| - '!tests/**/*.md' | |
| - '!docs/**' | |
| # The token in secrets.CN1SS_GH_TOKEN was generated on | |
| # Oct 16th 2025. If in Oct 2026 builds start failing, it | |
| # means the token needs to be regenerated: | |
| # 1. Go to https://github.com/settings/tokens -> "Developer settings" -> "Personal access tokens". | |
| # 2. Choose Fine-grained token (recommended). | |
| # 3. Grant: | |
| # * Repository access -> select Codename One | |
| # * Permissions: | |
| # * Contents -> Read and Write | |
| # * Pull requests -> Read and Write | |
| # * Issues -> Read and Write | |
| # 4. Copy the generated token | |
| # 5. Go to https://github.com/codenameone/CodenameOne/settings/secrets/actions | |
| # and edit the CN1SS_GH_TOKEN to use the new token | |
| concurrency: | |
| # Cancel superseded runs of this workflow for the same PR branch | |
| # (github.head_ref is set on pull_request events). On push to master | |
| # head_ref is empty, so the group falls back to the unique run_id and | |
| # every master commit is still tested in full -- no coverage lost. | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-android: | |
| name: Build Android ${{ matrix.name }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: "Default: 8" | |
| id: default | |
| - name: "JDK 17" | |
| id: jdk17 | |
| java_version: '17' | |
| - name: "JDK 21" | |
| id: jdk21 | |
| java_version: '21' | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.CN1SS_GH_TOKEN }} | |
| GH_TOKEN: ${{ secrets.CN1SS_GH_TOKEN }} | |
| # Optional: when set, build-android-app.sh writes it as a bundled resource | |
| # so the GoogleWebMap screenshot test renders a live Google map; absent | |
| # (e.g. fork PRs with no access to the secret) the test skips. | |
| GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }} | |
| # The device runner reports logical test failures through CN1SS log | |
| # markers, not through the launcher instrumentation test. Make the | |
| # normalized report authoritative so a red port-status test cannot leave | |
| # the Android workflow green and then be published from master. | |
| CN1SS_FAIL_ON_TEST_PROBLEMS: '1' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set TMPDIR | |
| run: echo "TMPDIR=${{ runner.temp }}" >> $GITHUB_ENV | |
| - name: Free Disk Space | |
| if: matrix.id != 'default' | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android/sdk/ndk | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /usr/share/swift | |
| - name: Setup JDK | |
| if: matrix.id != 'default' | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: ${{ matrix.java_version }} | |
| distribution: 'temurin' | |
| - name: Set JDK_HOME | |
| if: matrix.id != 'default' | |
| run: echo "JDK_HOME=${JAVA_HOME}" >> $GITHUB_ENV | |
| - name: Configure CN1SS options | |
| if: matrix.id != 'default' | |
| run: | | |
| echo "CN1SS_SKIP_COMMENT=1" >> $GITHUB_ENV | |
| echo "CN1SS_FAIL_ON_MISMATCH=1" >> $GITHUB_ENV | |
| echo "CN1SS_SKIP_COVERAGE=1" >> $GITHUB_ENV | |
| # Every leg fails on a screenshot mismatch, including this one. The default | |
| # leg differs from the JDK matrix legs only in what it ADDS (the PR comment | |
| # and coverage) -- never in what it tolerates. Before this step it had no | |
| # CN1SS_FAIL_ON_MISMATCH at all, so its comparison could report mismatches | |
| # into the PR comment while the job itself stayed green. | |
| - name: Configure CN1SS options (default leg) | |
| if: matrix.id == 'default' | |
| run: echo "CN1SS_FAIL_ON_MISMATCH=1" >> $GITHUB_ENV | |
| - name: Cache codenameone-tools | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ runner.temp }}/codenameone-tools | |
| key: ${{ runner.os }}-cn1-tools-${{ hashFiles('scripts/setup-workspace.sh') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cn1-tools- | |
| - name: Cache Maven repository | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-m2-android-${{ matrix.id }}-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-m2-android-${{ matrix.id }}- | |
| ${{ runner.os }}-m2- | |
| - name: Cache Gradle | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ matrix.id }}-${{ hashFiles('scripts/hellocodenameone/**/build.gradle*', 'scripts/hellocodenameone/**/gradle-wrapper.properties', 'Ports/Android/build.gradle*') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle-${{ matrix.id }}- | |
| ${{ runner.os }}-gradle- | |
| - name: Setup workspace | |
| run: ./scripts/setup-workspace.sh -q -DskipTests | |
| - name: Build Android port | |
| run: ./scripts/build-android-port.sh -q -DskipTests | |
| - name: Build Hello Codename One Android app | |
| id: build-android-app | |
| run: | | |
| mkdir -p ~/.codenameone | |
| cp maven/UpdateCodenameOne.jar ~/.codenameone/ | |
| ./scripts/build-android-app.sh -q -DskipTests | |
| - name: Enable KVM for Android emulator | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: Run Android instrumentation tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 36 | |
| arch: x86_64 | |
| target: google_apis | |
| disk-size: 2048M | |
| script: ./scripts/run-android-instrumentation-tests.sh "${{ steps.build-android-app.outputs.gradle_project_dir }}" | |
| - name: Upload Android port status | |
| if: always() && matrix.id == 'default' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: port-status-android | |
| path: artifacts/port-status-android.json | |
| if-no-files-found: warn | |
| retention-days: 14 | |
| - name: Upload emulator screenshot | |
| if: always() && matrix.id == 'default' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: emulator-screenshot | |
| path: artifacts/*.png | |
| if-no-files-found: warn | |
| retention-days: 14 | |
| compression-level: 6 | |
| - name: Upload emulator screenshot for JDK matrix | |
| if: always() && matrix.id != 'default' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: emulator-screenshot-${{ matrix.id }} | |
| path: artifacts/*.png | |
| if-no-files-found: warn | |
| retention-days: 14 | |
| compression-level: 6 | |
| - name: Upload Android Gradle logs | |
| if: always() && matrix.id == 'default' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: android-gradle-logs | |
| path: artifacts/*gradle*.log | |
| if-no-files-found: warn | |
| retention-days: 14 | |
| compression-level: 6 | |
| # Logcat captures from connectedAndroidTest and the in-script retry | |
| # (`connectedAndroidTest.log`, `connectedAndroidTest-retry.log`). These | |
| # are the only place to debug CN1SS chunk-decode flakes — they hold | |
| # the raw base64 chunks plus the `am start` / pidof diagnostics. If | |
| # this upload step disappears, the next decode flake will be | |
| # un-debuggable: keep it. | |
| - name: Upload Android instrumentation logs | |
| if: always() && matrix.id == 'default' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: android-instrumentation-logs | |
| path: artifacts/connectedAndroidTest*.log | |
| if-no-files-found: warn | |
| retention-days: 14 | |
| compression-level: 6 | |
| - name: Upload Android instrumentation logs for JDK matrix | |
| if: always() && matrix.id != 'default' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: android-instrumentation-logs-${{ matrix.id }} | |
| path: artifacts/connectedAndroidTest*.log | |
| if-no-files-found: warn | |
| retention-days: 14 | |
| compression-level: 6 | |
| - name: Upload Android test report | |
| if: always() && matrix.id == 'default' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: android-test-report | |
| path: artifacts/android-test-report | |
| if-no-files-found: warn | |
| retention-days: 14 | |
| compression-level: 6 | |
| - name: Upload Android Jacoco coverage report | |
| if: always() && matrix.id == 'default' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: android-jacoco-coverage | |
| path: artifacts/android-coverage-report | |
| if-no-files-found: warn | |
| retention-days: 14 | |
| compression-level: 6 |