-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (76 loc) · 2.39 KB
/
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Test
on: [ pull_request, push ]
jobs:
test:
strategy:
matrix:
java: [ 11,17 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: checkout repository
uses: actions/checkout@v2
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: ${{ matrix.java }}
- name: prepare gradle wrapper
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: clean
run: ./gradlew clean
- name: build
run: ./gradlew build
- name: clean log cache (Linux & macOS)
if: ${{ runner.os != 'Windows' }}
run: |
rm -rf ./logs
mkdir logs
- name: clean log cache (Windows)
if: ${{ runner.os == 'Windows' }}
run: |
if (Test-Path '.\logs') {
rd /s /q .\logs
}
mkdir .\logs
- name: test
run: ./gradlew test
- name: capture test log (Linux)
if: ${{ matrix.java == '17' && runner.os == 'Linux' }}
uses: actions/upload-artifact@v2
with:
name: test-log-linux-jdk17
path: ./logs/
- name: capture test log (Linux)
if: ${{ matrix.java == '11' && runner.os == 'Linux' }}
uses: actions/upload-artifact@v2
with:
name: test-log-linux-jdk11
path: ./logs/
- name: capture test log (macOS)
if: ${{ matrix.java == '17' && runner.os == 'macOS' }}
uses: actions/upload-artifact@v2
with:
name: test-log-macos-jdk17
path: ./logs/
- name: capture test log (macOS)
if: ${{ matrix.java == '11' && runner.os == 'macOS' }}
uses: actions/upload-artifact@v2
with:
name: test-log-macos-jdk11
path: ./logs/
- name: capture test log (Windows)
if: ${{ matrix.java == '17' && runner.os == 'Windows' }}
uses: actions/upload-artifact@v2
with:
name: test-log-windows-jdk17
path: .\logs\
- name: capture test log (Windows)
if: ${{ matrix.java == '11' && runner.os == 'Windows' }}
uses: actions/upload-artifact@v2
with:
name: test-log-windows-jdk11
path: .\logs\