-
Notifications
You must be signed in to change notification settings - Fork 7
51 lines (43 loc) · 1.35 KB
/
java-junit.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
name: Test Java + JUnit 4
on:
push:
paths:
- 'java-junit/**'
- '.github/workflows/java-junit.yml'
branches:
- with_assertions
pull_request:
paths:
- 'java-junit/**'
- '.github/workflows/java-junit.yml'
branches:
- with_assertions
jobs:
matrix_build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, windows-latest ]
java-version: [ 1.7, 1.8, 11, 16 ]
name: Java ${{ matrix.java-version }} Build on ${{ matrix.operating-system }}
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('java-junit/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and test without Modules
working-directory: java-junit
run: ./mvnw -B test
if: (matrix.java-version == '1.7') || (matrix.java-version == '1.8')
- name: Build and test with Modules
working-directory: java-junit
run: ./mvnw -B test -DargLine="--add-opens java.base/java.lang=ALL-UNNAMED"
if: (matrix.java-version != '1.7') && (matrix.java-version != '1.8')