-
Notifications
You must be signed in to change notification settings - Fork 42
67 lines (56 loc) · 1.66 KB
/
unit-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Test
on:
push:
branches:
- main
pull_request:
workflow_call:
jobs:
unit_test:
name: Run Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/[email protected]
- uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 17
- name: Cache Gradle Files
uses: actions/[email protected]
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Run Unit Tests
run: ./gradlew scratchoff:testDebugUnitTest
- name: Evaluate Test Report
uses: mikepenz/[email protected]
if: always()
with:
report_paths: 'scratchoff/build/test-results/testDebugUnitTest/TEST-*.xml'
- name: Generate Coverage Report
run: ./gradlew scratchoff:koverXmlReportDebug --stacktrace
- name: Store Coverage Artifact
uses: actions/[email protected]
with:
name: Test-Coverage
path: scratchoff/build/reports/kover/reportDebug.xml
report_test_coverage:
needs: unit_test
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
name: Test-Coverage
- uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: reportDebug.xml
flags: unit
fail_ci_if_error: true
verbose: true