Skip to content

Commit 43477b4

Browse files
committed
Switch from Travis to GitHub Actions
Add a Windows job, and use JDK 15 rather than 14. Only test each GWT version with a single JDK.
1 parent 35b0b52 commit 43477b4

File tree

2 files changed

+119
-30
lines changed

2 files changed

+119
-30
lines changed

.github/workflows/maven.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**/*.md'
7+
pull_request:
8+
paths-ignore:
9+
- '**/*.md'
10+
11+
# First build on Linux with JDK 8 and Windows with JDK 11
12+
# Then run tests with various JDK and GWT versions (Linux only)
13+
jobs:
14+
linux:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Setup environment
20+
run: echo "JAVA_HOME=${JAVA_HOME_8_X64}" | tee -a $GITHUB_ENV
21+
22+
- name: Cache Maven dependencies
23+
uses: actions/cache@v2
24+
with:
25+
path: |
26+
~/.m2/repository/
27+
!~/.m2/repository/**/*-SNAPSHOT/
28+
target/it-repo/
29+
!target/it-repo/**/*-SNAPSHOT/
30+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
31+
32+
- name: Build with Maven
33+
run: mvn -B -U -ntp verify --fail-at-end
34+
35+
windows:
36+
runs-on: windows-latest
37+
steps:
38+
- uses: actions/checkout@v2
39+
40+
- name: Setup environment
41+
run: echo "JAVA_HOME=${Env:JAVA_HOME_11_X64}" | Tee-Object -FilePath $env:GITHUB_ENV -Append
42+
43+
- name: Cache Maven dependencies
44+
uses: actions/cache@v2
45+
with:
46+
path: |
47+
~/.m2/repository/
48+
!~/.m2/repository/**/*-SNAPSHOT/
49+
target/it-repo/
50+
!target/it-repo/**/*-SNAPSHOT/
51+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
52+
53+
- name: Build with Maven
54+
run: mvn -B -U -ntp verify --fail-at-end
55+
56+
test-jdks:
57+
needs: linux
58+
runs-on: ubuntu-latest
59+
strategy:
60+
matrix:
61+
java: [ 11, 15 ]
62+
steps:
63+
- uses: actions/checkout@v2
64+
65+
- name: Setup JDK ${{ matrix.java }}
66+
id: setup-test-java
67+
if: matrix.java != 11
68+
uses: actions/setup-java@v1
69+
with:
70+
java-version: ${{ matrix.java }}
71+
72+
- name: Setup JAVA_HOME_${{ matrix.java }}_X64 environment variable
73+
if: matrix.java != 11
74+
run: echo "JAVA_HOME_${{ matrix.java }}_X64=${{ steps.setup-test-java.outputs.path }}" | tee -a $GITHUB_ENV
75+
76+
# TODO: investigate only running IT tests with that JDK, rather than the whole build, through Toolchains
77+
- name: Setup environment
78+
run: echo "JAVA_HOME=${JAVA_HOME_${{ matrix.java }}_X64}" | tee -a $GITHUB_ENV
79+
80+
- name: Cache Maven dependencies
81+
uses: actions/cache@v2
82+
with:
83+
path: |
84+
~/.m2/repository/
85+
!~/.m2/repository/**/*-SNAPSHOT/
86+
target/it-repo/
87+
!target/it-repo/**/*-SNAPSHOT/
88+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
89+
90+
- name: Build with Maven
91+
run: mvn -B -U -ntp verify --fail-at-end
92+
93+
94+
test-gwt:
95+
needs: linux
96+
runs-on: ubuntu-latest
97+
strategy:
98+
matrix:
99+
gwt: [ "2.8.2", "HEAD-SNAPSHOT" ]
100+
steps:
101+
- uses: actions/checkout@v2
102+
103+
- name: Setup environment
104+
run: echo "JAVA_HOME=${JAVA_HOME_8_X64}" | tee -a $GITHUB_ENV
105+
106+
- name: Cache Maven dependencies
107+
uses: actions/cache@v2
108+
with:
109+
path: |
110+
~/.m2/repository/
111+
!~/.m2/repository/**/*-SNAPSHOT/
112+
target/it-repo/
113+
!target/it-repo/**/*-SNAPSHOT/
114+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}-gwt-${{ matrix.gwt }}
115+
restore-keys: |
116+
${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
117+
118+
- name: Build with Maven
119+
run: mvn -B -U -ntp verify --fail-at-end -DgwtVersion=${{ matrix.gwt }}

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)