feat: New sample app (#36) #26
This file contains 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: CI | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
paths-ignore: | |
- '**.md' | |
- 'docs/**' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- 'docs/**' | |
concurrency: | |
# Limit concurrency to 1 for PRs. 'main' concurrency isn't limited. | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
CI: true | |
JAVA_VERSION: 17 | |
ORG_GRADLE_IDE_DOWNLOADJAVADOC: false | |
ORG_GRADLE_IDE_DOWNLOADSOURCES: false | |
jobs: | |
lib-build: | |
name: Build Library Not including MacOS | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Official Gradle Wrapper Validation Action | |
uses: gradle/actions/wrapper-validation@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: adopt | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Set up Gradle cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-gradle-${{ github.run_id }} | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
- name: Grant execute permission for gradlew script | |
run: chmod +x gradlew | |
- name: Build lib module | |
run: ./gradlew :compose-shadow:build --stacktrace -x check | |
lib-build-test-ios: | |
name: Build&Test IOS Library | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Official Gradle Wrapper Validation Action | |
uses: gradle/actions/wrapper-validation@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: adopt | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Grant execute permission for gradlew script | |
run: chmod +x gradlew | |
- name: Set up cocoapods | |
uses: maxim-lobanov/setup-cocoapods@v1 | |
with: | |
version: latest | |
- name: Build lib for iosArm64 | |
run: ./gradlew :compose-shadow:iosArm64ApiBuild --stacktrace -x check | |
- name: Build lib for iosSimulatorArm64 | |
run: ./gradlew :compose-shadow:iosSimulatorArm64ApiBuild --stacktrace -x check | |
- name: Build lib for iosX64 | |
run: ./gradlew :compose-shadow:iosX64ApiBuild --stacktrace -x check | |
- name: Run tests | |
run: ./gradlew :compose-shadow:iosSimulatorArm64Test | |
- name: Tests reporting | |
uses: mikepenz/action-junit-report@v4 | |
if: success() || failure() | |
with: | |
report_paths: '**/test-results/iosSimulatorArm64Test/**/*.xml' | |
detailed_summary: true | |
lib-api-verification: | |
name: API Signature Verification | |
runs-on: ubuntu-latest | |
needs: lib-build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: adopt | |
- name: Set up Gradle cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-gradle-${{ github.run_id }} | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
- name: Run API verification | |
run: ./gradlew :compose-shadow:apiCheck | |
lib-tests-android: | |
name: Android Unit&UI Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
api-level: [ 23, 34 ] | |
needs: lib-build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: adopt | |
- name: Enable KVM | |
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: Set up Gradle cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-gradle-${{ github.run_id }} | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
- name: Run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: x86_64 | |
script: ./gradlew :compose-shadow:connectedAndroidTest | |
- name: Tests reporting | |
uses: mikepenz/action-junit-report@v4 | |
if: success() || failure() | |
with: | |
report_paths: '**/androidTest-results/**/*.xml' | |
detailed_summary: true | |
lib-tests-jvm: | |
name: JVM Unit&UI Test | |
runs-on: ubuntu-latest | |
needs: lib-build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: adopt | |
- name: Set up Gradle cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-gradle-${{ github.run_id }} | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
- name: Run tests | |
run: ./gradlew :compose-shadow:jvmTest | |
- name: Tests reporting | |
uses: mikepenz/action-junit-report@v4 | |
if: success() || failure() | |
with: | |
report_paths: '**/test-results/jvmTest/**/*.xml' | |
detailed_summary: true | |
lib-tests-wasmjs: | |
name: WASM Unit&UI Test | |
runs-on: ubuntu-latest | |
needs: lib-build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: adopt | |
- name: Set up Gradle cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-gradle-${{ github.run_id }} | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
- name: Run tests | |
run: ./gradlew :compose-shadow:wasmJsTest | |
- name: Tests reporting | |
uses: mikepenz/action-junit-report@v4 | |
if: success() || failure() | |
with: | |
report_paths: '**/test-results/wasmJsBrowserTest/**/*.xml' | |
detailed_summary: true | |
sample-app-build: | |
name: Build Sample App | |
runs-on: ubuntu-latest | |
needs: lib-build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: adopt | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Set up Gradle cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-gradle-${{ github.run_id }} | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
- name: Build sample app | |
run: ./gradlew :sample:compose-app:build -x check | |
delete-cache: | |
name: Delete cache | |
permissions: write-all | |
if: always() | |
runs-on: ubuntu-latest | |
needs: | |
- lib-api-verification | |
- lib-tests-android | |
- lib-tests-jvm | |
- lib-tests-wasmjs | |
- sample-app-build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Delete cache | |
run: | | |
gh extension install actions/gh-actions-cache | |
set +e | |
gh actions-cache delete ${{ runner.os }}-gradle-${{ github.run_id }} --confirm | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |