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-06-12 14:57:54 +03:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
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-08-21 14:58:22 +03:00
|
|
|
uses: gradle/gradle-build-action@243af859f8ca30903d9d7f7936897ca0358ba691 # v2.7.1
|
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-01-09 14:04:23 +03:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
|
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/
|