-
Notifications
You must be signed in to change notification settings - Fork 36
62 lines (49 loc) · 1.37 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
name: Build
on: [ push ]
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
build:
needs: prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# build and test against LTS releases
java: [ 8, 11, 17 ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle Wrapper
run: ./gradlew build -x test
- name: Test with Gradle Wrapper
run: ./gradlew test
- name: Build simple-console example
run: |
./gradlew publishToMavenLocal
cd examples/simple-console
./gradlew build
- name: Upload report if failed
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: Reports-JDK_${{ matrix.java }}
path: build/reports
- uses: actions/upload-artifact@v1
with:
name: Package-JDK_${{ matrix.java }}
path: build/libs