1+ # This workflow will build a Java project with Gradle
2+ # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+ name : Build & test
5+
6+ on :
7+ push :
8+ branches : [ master, develop ]
9+ pull_request :
10+ branches : [ master, develop ]
11+
12+
13+ jobs :
14+ buildon-linux :
15+ strategy :
16+ matrix :
17+ os : [ ubuntu-latest ]
18+ # New gradle doesn't run on <= 8
19+ # Java >= 12 doesn't support source/target level 6 anymore
20+ java : [ 8, 9, 10, 11 ]
21+ architecture : [ x86, x64 ]
22+ runs-on : ${{ matrix.os }}
23+ steps :
24+ - uses : actions/checkout@v2
25+ - name : Set up JDK ${{ matrix.java }}
26+ uses : actions/setup-java@v1
27+ with :
28+ java-version : ${{ matrix.java }}
29+ architecture : ${{ matrix.architecture }}
30+ - name : Cache Gradle packages
31+ uses : actions/cache@v2
32+ with :
33+ path : ~/.gradle/caches
34+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
35+ restore-keys : ${{ runner.os }}-gradle
36+ - name : Grant execute permission for gradlew
37+ run : chmod +x gradlew
38+ - name : Build with Gradle
39+ run : ./gradlew clean build
40+ build-on-macos :
41+ strategy :
42+ matrix :
43+ os : [ macos-latest ]
44+ # New gradle doesn't run on <= 8
45+ # Java >= 12 doesn't support source/target level 6 anymore
46+ java : [ 8, 9, 10, 11 ]
47+ # MacOS has no support for x86 ("Error: No valid download found for version 11.x and package jdk.")
48+ architecture : [ x64 ]
49+ runs-on : ${{ matrix.os }}
50+ steps :
51+ - uses : actions/checkout@v2
52+ - name : Set up JDK ${{ matrix.java }}
53+ uses : actions/setup-java@v1
54+ with :
55+ java-version : ${{ matrix.java }}
56+ architecture : ${{ matrix.architecture }}
57+ - name : Cache Gradle packages
58+ uses : actions/cache@v2
59+ with :
60+ path : ~/.gradle/caches
61+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
62+ restore-keys : ${{ runner.os }}-gradle
63+ - name : Grant execute permission for gradlew
64+ run : chmod +x gradlew
65+ - name : Build with Gradle
66+ run : ./gradlew clean build
67+ build-on-windows :
68+ strategy :
69+ matrix :
70+ os : [ windows-latest ]
71+ # New gradle doesn't run on <= 8
72+ # Java >= 12 doesn't support source/target level 6 anymore
73+ java : [ 8, 9, 10, 11 ]
74+ architecture : [ x86, x64 ]
75+ runs-on : ${{ matrix.os }}
76+ steps :
77+ - uses : actions/checkout@v2
78+ - name : Set up JDK ${{ matrix.java }}
79+ uses : actions/setup-java@v1
80+ with :
81+ java-version : ${{ matrix.java }}
82+ architecture : ${{ matrix.architecture }}
83+ - name : Cache Gradle packages
84+ uses : actions/cache@v2
85+ with :
86+ path : ~/.gradle/caches
87+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
88+ restore-keys : ${{ runner.os }}-gradle
89+ - name : Grant execute permission for gradlew
90+ run : chmod +x gradlew
91+ - name : Build with Gradle
92+ run : ./gradlew clean build
0 commit comments