-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (54 loc) · 1.74 KB
/
build.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
68
name: Build
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v2
- name: set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: Generate cache key
run: ./checksum.sh checksum.txt
- uses: actions/cache@v1
continue-on-error: true # continue if the cache restore/upload fails
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: ${{ runner.os }}-gradle-${{ hashFiles('checksum.txt') }}
- name: Build and check
run: ./gradlew spotlessCheck detektCheck assembleDebug --stacktrace
- name: Run unit tests
run: ./gradlew testDebugUnitTest
- name: Run code coverage
run: ./gradlew jacocoTestReport mergeJacocoReports jacocoTestReportMerged
- name: Upload code coverage to codecov
run: bash <(curl -s https://codecov.io/bash)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload build reports
uses: actions/upload-artifact@v1
with:
name: build-reports
path: build/reports
- name: Copy test results
if: always()
run: |
mkdir -p junit
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} junit/ \;
- name: Upload test results
uses: actions/upload-artifact@v1
with:
name: junit-results
path: junit