-
Notifications
You must be signed in to change notification settings - Fork 101
106 lines (103 loc) · 3.51 KB
/
test_pack_doc.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Test Package Document
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ prereleased, released ]
jobs:
validate_gradle_wrapper:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
test:
needs: [ validate_gradle_wrapper ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
java_version: [ 11, 17 ]
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'temurin'
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Run tests on Java ${{ matrix.java_version }} and ${{ matrix.os }}
uses: gradle/gradle-build-action@v2
with:
# We run test aggregation with --continue to make sure all tests run, even if some fail.
arguments: testAggregateTestReport --continue
- name: Persist aggregated test reports on failure - Java ${{ matrix.java_version }} on ${{ matrix.os }}
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: Test report - Java ${{ matrix.java_version }} on ${{ matrix.os }}
path: build/reports/tests/unit-test/aggregated-results/
package:
needs: [test]
runs-on: ${{ matrix.os }}
strategy:
matrix:
java_version: [ 11, 17 ]
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'temurin'
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Package cli app jar with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: shadowJar
- name: Persist cli app jar
uses: actions/upload-artifact@v3
with:
name: Application - CLI executable - Java ${{ matrix.java_version }} JAR file -- ${{ matrix.os }}
path: cli/build/libs/gtfs-validator-*-cli.jar
doc:
needs: [test]
runs-on: ${{ matrix.os }}
strategy:
matrix:
java_version: [ 11, 17 ]
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'temurin'
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build Javadoc
uses: gradle/gradle-build-action@v2
with:
arguments: aggregateJavadoc
- name: Persist javadoc
uses: actions/upload-artifact@v3
with:
name: Documentation - javadoc - Java ${{ matrix.java_version }} - ${{ matrix.java_version }}
path: build/docs/javadoc/