-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (51 loc) · 1.77 KB
/
Copy pathci.yml
File metadata and controls
51 lines (51 loc) · 1.77 KB
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
name: CI
on: [push]
jobs:
build:
strategy:
matrix:
# https://github.com/actions/setup-java#matrix-testing
java: [8, 11]
os: [ubuntu-latest, windows-latest]
#os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
name: Java ${{ matrix.java }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Setup java
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Run command
run: echo single line command..
- name: Run Multi line commands
run: |
echo multi line command...
# https://github.com/eskatos/gradle-command-action#setup-and-use-a-declared-gradle-version
- uses: eskatos/gradle-command-action@v1
with:
gradle-version: 6.1.1
arguments: clean build -S
# https://github.com/actions/cache/blob/master/examples.md#java---gradle
- name: Cache npm
uses: actions/cache@v1
with:
path: ~/.npm
#key: ${{ matrix.java }}-${{ matrix.os }}-cache
key: java-${{ matrix.java }}-${{ runner.os }}-${{ matrix.os }}-gradle-${{ hashFiles('**/node_modules/**') }}
restore-keys: |
java-${{ matrix.java }}-${{ runner.os }}-${{ matrix.os }}-gradle-
- name: Cache gradle
uses: actions/cache@v1
with:
path: ~/.gradle
#key: ${{ matrix.java }}-${{ matrix.os }}-cache
key: java-${{ matrix.java }}-${{ runner.os }}-${{ matrix.os }}-gradle-${{ hashFiles('**/.gradle/**') }}
restore-keys: |
java-${{ matrix.java }}-${{ runner.os }}-${{ matrix.os }}-gradle-
## This is also works:
#- name: Cache
# uses: actions/cache@v1.1.2
# with:
# path: ~/.gradle
# key: ${{ matrix.java }}-${{ matrix.os }}-cache