-
Notifications
You must be signed in to change notification settings - Fork 12
64 lines (54 loc) · 1.5 KB
/
pull-request-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
name: Test and Lint
on:
pull_request:
workflow_call:
jobs:
build:
name: Build with JDK ${{ matrix.java-version }}
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [11, 17]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: 'gradle'
- name: Build
run: ./gradlew build -x test
- name: Upload build results
if: always()
uses: actions/upload-artifact@v4
with:
# artifacts name
name: build-results-${{ matrix.java-version }}
# copy reports of all packages
path: '**/build/reports/**'
# artifact will expire in 7 days.
retention-days: 7
test-and-lint:
name: Test and Lint with JDK 17
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Unit Test
run: ./gradlew testDebugUnitTest
- name: Lint
run: ./gradlew ktlintCheck
- name: Upload test and lint results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-and-lint-results
path: '**/build/reports/**'
retention-days: 7