Merge pull request #202 from caarmen/remove-retrolambda #21
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: Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
UnitTests: | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: Run unit tests | |
run: ./gradlew --no-daemon testDebugUnitTest jacocoTestReport | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: always() # always run even if the previous step fails | |
with: | |
report_paths: "app/build/test-results/testDebugUnitTest/*.xml" | |
check_name: UnitTests | |
- name: Add coverage to PR | |
id: jacoco | |
uses: madrapps/[email protected] | |
with: | |
paths: | | |
${{ github.workspace }}/app/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Archive unit tests | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: unit-tests | |
path: app/build/reports/tests/testDebugUnitTest | |
- name: Archive coverage | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage | |
path: app/build/reports/jacoco |