Fix docs #119
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 | |
| on: | |
| pull_request_target: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - 'doc/**' | |
| - '**.md' | |
| - '**.txt' | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - 'doc/**' | |
| - '**.md' | |
| - '**.txt' | |
| jobs: | |
| test-linux: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Setup | |
| uses: ./.github/actions/build-setup | |
| with: | |
| configuration_cache_key: secrets.GRADLE_CONFIGURATION_CACHE_KEY | |
| - name: Build and Test | |
| run: | | |
| ./gradlew allTests assembleAndroidDeviceTest assembleAndroidDeviceTest \ | |
| -PkniNativeBuildType=debug \ | |
| -PkniAllowedTargets=linuxX64,androidNativeArm64,wasmJs,js,wasmWasi | |
| env: | |
| GRADLE_OPTS: >- | |
| -Dorg.gradle.jvmargs="-Xmx12g -XX:+UseG1GC -XX:MaxMetaspaceSize=512m" | |
| -Dkotlin.daemon.jvm.options="-Xmx2048m" | |
| - name: Upload Test Report | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: test-report-ubuntu-latest | |
| path: ./**/build/test-results/**/*.xml | |
| retention-days: 5 | |
| - name: Upload Android Test APK (e2e) | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: e2e-androidTest.apk | |
| path: ./e2e/build/outputs/apk/androidTest/e2e-androidTest.apk | |
| archive: false | |
| - name: Upload Android Test APK (plugintest) | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: plugintest-androidTest.apk | |
| path: ./plugintest/build/outputs/apk/androidTest/plugintest-androidTest.apk | |
| archive: false | |
| - name: Upload Android Test APK (buffers) | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: buffers-androidTest.apk | |
| path: ./buffers/build/outputs/apk/androidTest/buffers-androidTest.apk | |
| archive: false | |
| test-windows: | |
| permissions: | |
| contents: read | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Setup | |
| uses: ./.github/actions/build-setup | |
| with: | |
| configuration_cache_key: secrets.GRADLE_CONFIGURATION_CACHE_KEY | |
| - name: Build and Test | |
| run: ./gradlew allTests -PkniNativeBuildType=debug -PkniAllowedTargets=mingwX64 | |
| env: | |
| GRADLE_OPTS: >- | |
| -Dorg.gradle.jvmargs="-Xmx12g -XX:+UseG1GC -XX:MaxMetaspaceSize=512m" | |
| -Dkotlin.daemon.jvm.options="-Xmx2048m" | |
| - name: Upload Test Report | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: test-report-windows-latest | |
| path: ./**/build/test-results/**/*.xml | |
| test-macos: | |
| permissions: | |
| contents: read | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Setup | |
| uses: ./.github/actions/build-setup | |
| with: | |
| configuration_cache_key: secrets.GRADLE_CONFIGURATION_CACHE_KEY | |
| - name: Build and Test | |
| run: | | |
| ./gradlew allTests -PkniNativeBuildType=debug \ | |
| -PkniAllowedTargets=macosArm64,iosSimulatorArm64,tvosSimulatorArm64,watchosSimulatorArm64 | |
| env: | |
| GRADLE_OPTS: >- | |
| -Dorg.gradle.jvmargs="-Xmx5g -XX:+UseG1GC -XX:MaxMetaspaceSize=512m" | |
| -Dkotlin.daemon.jvm.options="-Xmx2048m" | |
| - name: Upload Test Report | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: test-report-macos-latest | |
| path: ./**/build/test-results/**/*.xml | |
| test-android: | |
| needs: ["test-linux"] | |
| strategy: | |
| matrix: | |
| module: ["e2e", "plugintest", "buffers"] | |
| fail-fast: false | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ${{matrix.module}}-androidTest.apk | |
| - name: Set up google cloud | |
| uses: google-github-actions/setup-gcloud@v1 | |
| with: | |
| service_account_key: ${{ secrets.GCLOUD_AUTH }} | |
| - name: Auth google cloud | |
| uses: 'google-github-actions/auth@v3' | |
| with: | |
| project_id: 'kotlin-jni' | |
| credentials_json: ${{ secrets.GCLOUD_AUTH }} | |
| - name: Set current project | |
| run: gcloud config set project ${{ secrets.FIREBASE_PROJECT_ID }} | |
| - name: Run Instrumentation Tests in Firebase Test Lab | |
| continue-on-error: true | |
| env: | |
| APP_DEBUG_LOCATION: ${{matrix.module}}-androidTest.apk | |
| ANDROID_TEST_LOCATION: ${{matrix.module}}-androidTest.apk | |
| DEVICE_MODEL: SmallPhone.arm,version=35 | |
| run: > | |
| gcloud firebase test android run | |
| --type instrumentation | |
| --app $APP_DEBUG_LOCATION | |
| --test $ANDROID_TEST_LOCATION | |
| --device model=$DEVICE_MODEL | |
| --results-bucket=jni-firebase-test | |
| --results-dir="run-${{ github.run_id }}" | |
| --no-record-video | |
| - name: Download Results | |
| run: | | |
| mkdir -p firebase-results/${{matrix.module}} | |
| # Replace 'your-bucket-name' with your actual bucket (e.g. test-lab-xxxx) | |
| gcloud storage cp -r "gs://jni-firebase-test/run-${{ github.run_id }}/**/test_result_*.xml" ./firebase-results/${{matrix.module}}/ | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: test-report-ubuntu-android-${{matrix.module}} | |
| path: firebase-results/${{matrix.module}}/ | |
| publish-results: | |
| needs: | |
| - test-linux | |
| - test-android | |
| - test-macos | |
| - test-windows | |
| runs-on: ubuntu-latest | |
| if: always() | |
| permissions: | |
| contents: read | |
| checks: write | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v6 | |
| with: | |
| sparse-checkout: | | |
| .github/actions | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v8 | |
| - name: Multiplatform Test Report | |
| uses: dshatz/testballoon-github-reporter@master | |
| with: | |
| reports: "test-report-*/**/*.xml" | |
| platform-hints: | | |
| { | |
| "test-report-ubuntu-latest/**/*.xml": "Linux", | |
| "test-report-windows-latest/**/*.xml": "Windows", | |
| "test-report-macos-latest/**/*.xml": "macOS", | |
| "test-report-ubuntu-android-*/**/*.xml": "Android" | |
| } |