UJ: stopEvents #684
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: 'ci' | |
| permissions: | |
| contents: read | |
| actions: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - '**.md' | |
| pull_request: | |
| paths-ignore: | |
| - '**.md' | |
| workflow_dispatch: | |
| env: | |
| JAVA_VERSION: '17' | |
| jobs: | |
| test: | |
| name: 'Test Unit' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: adopt | |
| - uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 | |
| with: | |
| cache-read-only: ${{ github.event_name == 'pull_request' }} | |
| - name: 'Build' | |
| run: ./gradlew build --stacktrace | |
| - name: 'HTML ES5 test' | |
| run: | | |
| npm install -g jshint | |
| java -cp sdk/build/intermediates/javac/release/compileReleaseJavaWithJavac/classes com.hcaptcha.sdk.HCaptchaHtml > sdk/build/hcaptcha-form.html | |
| jshint --extract=always sdk/build/hcaptcha-form.html | |
| - name: 'JitPack Test' | |
| run: ./gradlew publishReleasePublicationToMavenLocal | |
| build-matrix: | |
| name: 'Build (target:${{ matrix.target }} compile:${{ matrix.compile }} appcompat: ${{ matrix.appcompat }})' | |
| needs: test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - compile: 35 | |
| target: 34 | |
| appcompat: 1.6.1 | |
| - compile: 34 | |
| target: 34 | |
| appcompat: 1.6.1 | |
| - compile: 34 | |
| target: 33 | |
| appcompat: 1.5.1 | |
| - compile: 34 | |
| target: 32 | |
| appcompat: 1.4.2 | |
| - compile: 34 | |
| target: 31 | |
| appcompat: 1.3.1 | |
| - compile: 34 | |
| target: 30 | |
| appcompat: 1.3.1 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: adopt | |
| - uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 | |
| with: | |
| cache-read-only: ${{ github.event_name == 'pull_request' }} | |
| - run: | | |
| ./gradlew build -PexampleCompileSdkVersion=${{ matrix.compile }} \ | |
| -PexampleTargetSdkVersion=${{ matrix.target }} \ | |
| -PexampleAppcompatVersion=${{ matrix.appcompat }} | |
| test-ui: | |
| name: 'Test UI' | |
| needs: test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: adopt | |
| - uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 | |
| with: | |
| cache-read-only: ${{ github.event_name == 'pull_request' }} | |
| - name: Run tests | |
| uses: ./.github/actions/android-emulator-run | |
| with: | |
| script: "parallel --retries 3 ::: './gradlew test:connectedCheck'" | |
| fresh-avd: true | |
| - if: failure() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: androidTest-results | |
| path: | | |
| test/build/outputs/androidTest-results | |
| test/build/reports/androidTests | |
| test-minified: | |
| name: 'Test UI Minified' | |
| needs: [ test-ui ] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: adopt | |
| - uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 | |
| with: | |
| cache-read-only: ${{ github.event_name == 'pull_request' }} | |
| - name: Run tests | |
| uses: ./.github/actions/android-emulator-run | |
| with: | |
| script: "parallel --retries 3 ::: './gradlew test:connectedCheck -P testingMinimizedBuild=true -P android.enableR8.fullMode=false'" | |
| fresh-avd: true | |
| - if: failure() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: androidTest-minified-results | |
| path: | | |
| test/build/outputs/androidTest-results | |
| test/build/reports/androidTests | |
| test-benchmark: | |
| name: 'Test Benchmark' | |
| needs: test | |
| runs-on: macos-15-intel | |
| timeout-minutes: 30 | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| issues: write | |
| actions: read | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: adopt | |
| - uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 | |
| with: | |
| cache-read-only: ${{ github.event_name == 'pull_request' }} | |
| - name: Run tests | |
| uses: ./.github/actions/android-emulator-run | |
| with: | |
| api-level: 29 | |
| fresh-avd: true | |
| script: | | |
| adb uninstall com.hcaptcha.sdk.bench.test || true | |
| ./gradlew benchmark:connectedReleaseAndroidTest | |
| - if: always() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: androidTest-benchmark-results | |
| path: | | |
| benchmark/build/outputs/ | |
| benchmark/build/reports/ | |
| - name: Diff benchmark result | |
| id: diff-benchmark | |
| uses: ./.github/actions/android-benchmark-diff | |
| with: | |
| reference: benchmark/data/ci-benchmarkData.json | |
| compare-with: benchmark/build/outputs/connected_android_test_additional_output/releaseAndroidTest/connected/test(AVD) - 10/com_hcaptcha_sdk_bench_test-benchmarkData.json | |
| - name: Log diff benchmark reuslts | |
| run: echo "${{ steps.diff-benchmark.outputs.markdown-table }}" | |
| - uses: hCaptcha/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e | |
| if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main' | |
| id: find_comment | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body-includes: Benchmark report | |
| - uses: hCaptcha/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 | |
| if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' && (steps.diff-benchmark.outputs.markdown-table != null || steps.find_comment.outputs.comment-id != null) }} | |
| with: | |
| body: | | |
| Benchmark report: | |
| ${{ steps.diff-benchmark.outputs.markdown-table }} | |
| edit-mode: replace | |
| comment-id: ${{ steps.find_comment.outputs.comment-id }} | |
| issue-number: ${{ github.event.pull_request.number }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: benchmark-json-output | |
| path: benchmark/build/outputs/connected_android_test_additional_output | |
| size-report: | |
| name: 'Diffuse report' | |
| needs: [ test ] | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| issues: write | |
| actions: read | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: adopt | |
| - uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 | |
| with: | |
| cache-read-only: ${{ github.event_name == 'pull_request' }} | |
| - name: 'Build' | |
| run: | | |
| ./gradlew clean build --stacktrace | |
| cp sdk/build/outputs/aar/sdk-release.aar sdk-pr.aar | |
| - name: 'Build main' | |
| run: | | |
| git checkout origin/main | |
| ./gradlew clean build --stacktrace | |
| cp sdk/build/outputs/aar/sdk-release.aar sdk-main.aar | |
| - id: diffuse | |
| uses: usefulness/diffuse-action@41995fe8ff6be0a8847e63bdc5a4679c704b455c | |
| with: | |
| old-file-path: sdk-main.aar | |
| new-file-path: sdk-pr.aar | |
| - uses: hCaptcha/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e | |
| id: find_comment | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body-includes: Diffuse report | |
| - uses: hCaptcha/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 | |
| if: ${{ steps.diffuse.outputs.diff-raw != null || steps.find_comment.outputs.comment-id != null }} | |
| with: | |
| body: | | |
| Diffuse report: | |
| ${{ steps.diffuse.outputs.diff-gh-comment }} | |
| edit-mode: replace | |
| comment-id: ${{ steps.find_comment.outputs.comment-id }} | |
| issue-number: ${{ github.event.pull_request.number }} | |
| token: ${{ secrets.GITHUB_TOKEN }} |