-
Notifications
You must be signed in to change notification settings - Fork 26
45 lines (42 loc) · 1.46 KB
/
unit-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
name: Unit Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
unit-test:
name: Unit Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
# ref: https://www.oracle.com/java/technologies/java-se-support-roadmap.html
java-version: [ "8", "11", "15" ]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
# cache Gradle package to speed up future runs after a successful run.
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ matrix.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ matrix.os }}-gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# gradle build process include test phase.
- name: Build with Gradle
run: ./gradlew build
# store the built packages as part of the workflow run.
# Allow us to download these artifacts and import to project to help local test.
# with matrix, Each job overwrites what was previously uploaded, but it's fine for us.
- uses: actions/upload-artifact@v2
with:
name: Package
path: build/libs
retention-days: 7