-
Notifications
You must be signed in to change notification settings - Fork 2
35 lines (32 loc) · 1.15 KB
/
build+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
name: Build and test
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
java_version: "17"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: "${{env.java_version}}"
distribution: temurin
cache: gradle # caches dependencies (https://github.com/actions/setup-java#caching-packages-dependencies)
- name: Build project and run unit tests (local flavor)
run: ./gradlew test unitTestCoverageReport --stacktrace
- name: Add coverage comment to PR
# Action uses deprecated features (https://github.com/Madrapps/jacoco-report/issues/35).
uses: madrapps/[email protected]
with:
paths: "${{github.workspace}}/app/build/reports/jacoco/unitTestCoverageReport/unitTestCoverageReport.xml"
token: "${{secrets.GITHUB_TOKEN}}"
- name: Store HTML coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: "${{github.workspace}}/app/build/reports/jacoco/unitTestCoverageReport/html/"