Update unit-and-instrumented-tests-action.yml #985
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: unit-and-instrumented-tests | |
| on: | |
| workflow_dispatch: | |
| push: | |
| env: | |
| API_CURRENT: 35 | |
| JAVA_DISTRIBUTION: 'corretto' | |
| JAVA_VERSION: '17' | |
| jobs: | |
| unit-test-api-level-current: | |
| name: unit-test-api-level-$API_CURRENT | |
| runs-on: macos-13 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| # repo's gradle is configured to run on java 17 | |
| - name: Setup java 17 for gradle | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: ${{ env.JAVA_DISTRIBUTION }} | |
| java-version: ${{ env.JAVA_VERSION }} | |
| - name: Run unit tests | |
| run: | | |
| ./gradlew :Branch-SDK:testDebugUnitTest | |
| # contains the reports and apk | |
| - name: Save test artifacts | |
| if: success() || failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: unit-test-api-level-$API_CURRENT | |
| path: ./Branch-SDK/build/ | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - 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: run tests | |
| uses: reactivecircus/[email protected] | |
| with: | |
| api-level: 29 | |
| script: ./gradlew :Branch-SDK:connectedDebugAndroidTest | |
| # contains the reports and apk | |
| - name: Save test artifacts | |
| if: success() || failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: instrumented-test-api-level-$API_CURRENT | |
| path: ./Branch-SDK/build/ |