2022-04-26 16:00:41 +03:00
|
|
|
name: Unit tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches: [ master, stable-* ]
|
|
|
|
push:
|
|
|
|
branches: [ master, stable-* ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up JDK 11
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
distribution: "temurin"
|
|
|
|
java-version: 11
|
2022-04-27 09:43:51 +03:00
|
|
|
- name: Delete old comments
|
|
|
|
if: ${{ always() }}
|
|
|
|
run: scripts/deleteOldComments.sh "test" "Unit" ${{github.event.number}} ${{ secrets.GITHUB_TOKEN }}
|
2022-04-26 16:00:41 +03:00
|
|
|
- name: Run unit tests with coverage
|
|
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
with:
|
|
|
|
arguments: jacocoTestGplayDebugUnitTest
|
2022-04-27 09:43:51 +03:00
|
|
|
- name: Upload failing results
|
|
|
|
if: ${{ failure() }}
|
|
|
|
run:
|
|
|
|
scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "test" "Unit" ${{github.event.number}} ${{ secrets.GITHUB_TOKEN }}
|
2022-04-26 16:00:41 +03:00
|
|
|
- name: Upload coverage to codecov
|
2022-05-02 14:18:13 +03:00
|
|
|
uses: codecov/codecov-action@v3
|
2022-04-26 16:00:41 +03:00
|
|
|
with:
|
2022-04-27 09:43:51 +03:00
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
2022-04-27 11:19:23 +03:00
|
|
|
flags: unit
|
2022-04-26 16:00:41 +03:00
|
|
|
fail_ci_if_error: true
|
|
|
|
- name: Upload jacoco artifacts
|
|
|
|
if: ${{ failure() }}
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: test-results
|
2022-04-27 09:43:51 +03:00
|
|
|
path: app/build/reports/tests/testGplayDebugUnitTest/
|