2022-04-26 16:00:41 +03:00
|
|
|
name: Unit tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches: [ master, stable-* ]
|
|
|
|
push:
|
|
|
|
branches: [ master, stable-* ]
|
|
|
|
|
2022-06-10 09:03:43 +03:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pull-requests: write
|
|
|
|
|
2023-06-08 14:53:06 +03:00
|
|
|
concurrency:
|
|
|
|
group: unit-tests-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-04-26 16:00:41 +03:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-25 14:26:15 +03:00
|
|
|
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
|
2023-05-08 19:35:05 +03:00
|
|
|
- name: Set up JDK 17
|
2023-08-07 15:00:36 +03:00
|
|
|
uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
|
2022-04-26 16:00:41 +03:00
|
|
|
with:
|
|
|
|
distribution: "temurin"
|
2023-05-08 19:35:05 +03:00
|
|
|
java-version: 17
|
2022-04-27 09:43:51 +03:00
|
|
|
- name: Delete old comments
|
2022-05-31 11:07:03 +03:00
|
|
|
env:
|
2022-12-16 12:18:51 +03:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-04-27 09:43:51 +03:00
|
|
|
if: ${{ always() }}
|
2022-05-31 11:07:03 +03:00
|
|
|
run: scripts/deleteOldComments.sh "test" "Unit" ${{github.event.number}}
|
2022-04-26 16:00:41 +03:00
|
|
|
- name: Run unit tests with coverage
|
2023-09-04 14:23:56 +03:00
|
|
|
uses: gradle/gradle-build-action@ef76a971e2fa3f867b617efd72f2fbd72cf6f8bc # v2.8.0
|
2022-04-26 16:00:41 +03:00
|
|
|
with:
|
|
|
|
arguments: jacocoTestGplayDebugUnitTest
|
2022-04-27 09:43:51 +03:00
|
|
|
- name: Upload failing results
|
|
|
|
if: ${{ failure() }}
|
2022-05-31 11:07:03 +03:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-12-16 12:18:51 +03:00
|
|
|
run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "test" "Unit" ${{github.event.number}}
|
2022-04-26 16:00:41 +03:00
|
|
|
- name: Upload coverage to codecov
|
2023-05-22 14:58:14 +03:00
|
|
|
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
|
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() }}
|
2023-09-11 14:09:33 +03:00
|
|
|
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
|
2022-04-26 16:00:41 +03:00
|
|
|
with:
|
|
|
|
name: test-results
|
2022-04-27 09:43:51 +03:00
|
|
|
path: app/build/reports/tests/testGplayDebugUnitTest/
|