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-10-23 14:50:49 +03:00
|
|
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-05-08 19:35:05 +03:00
|
|
|
- name: Set up JDK 17
|
2023-12-04 14:50:03 +03:00
|
|
|
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.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
|
2024-01-28 23:32:57 +03:00
|
|
|
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.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
|
2024-01-28 23:48:34 +03:00
|
|
|
uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # v3.1.5
|
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() }}
|
2024-01-28 23:31:51 +03:00
|
|
|
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
|
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/
|