Skip to content

Commit

Permalink
Switch from Travis to GitHub Actions
Browse files Browse the repository at this point in the history
Add a Windows job, and use JDK 15 rather than 14.
Only test each GWT version with a single JDK.
  • Loading branch information
tbroyer committed Jan 7, 2021
1 parent 35b0b52 commit 43477b4
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 30 deletions.
119 changes: 119 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: CI

on:
push:
paths-ignore:
- '**/*.md'
pull_request:
paths-ignore:
- '**/*.md'

# First build on Linux with JDK 8 and Windows with JDK 11
# Then run tests with various JDK and GWT versions (Linux only)
jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup environment
run: echo "JAVA_HOME=${JAVA_HOME_8_X64}" | tee -a $GITHUB_ENV

- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: |
~/.m2/repository/
!~/.m2/repository/**/*-SNAPSHOT/
target/it-repo/
!target/it-repo/**/*-SNAPSHOT/
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

- name: Build with Maven
run: mvn -B -U -ntp verify --fail-at-end

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- name: Setup environment
run: echo "JAVA_HOME=${Env:JAVA_HOME_11_X64}" | Tee-Object -FilePath $env:GITHUB_ENV -Append

- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: |
~/.m2/repository/
!~/.m2/repository/**/*-SNAPSHOT/
target/it-repo/
!target/it-repo/**/*-SNAPSHOT/
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

- name: Build with Maven
run: mvn -B -U -ntp verify --fail-at-end

test-jdks:
needs: linux
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 11, 15 ]
steps:
- uses: actions/checkout@v2

- name: Setup JDK ${{ matrix.java }}
id: setup-test-java
if: matrix.java != 11
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- name: Setup JAVA_HOME_${{ matrix.java }}_X64 environment variable
if: matrix.java != 11
run: echo "JAVA_HOME_${{ matrix.java }}_X64=${{ steps.setup-test-java.outputs.path }}" | tee -a $GITHUB_ENV

# TODO: investigate only running IT tests with that JDK, rather than the whole build, through Toolchains
- name: Setup environment
run: echo "JAVA_HOME=${JAVA_HOME_${{ matrix.java }}_X64}" | tee -a $GITHUB_ENV

- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: |
~/.m2/repository/
!~/.m2/repository/**/*-SNAPSHOT/
target/it-repo/
!target/it-repo/**/*-SNAPSHOT/
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

- name: Build with Maven
run: mvn -B -U -ntp verify --fail-at-end


test-gwt:
needs: linux
runs-on: ubuntu-latest
strategy:
matrix:
gwt: [ "2.8.2", "HEAD-SNAPSHOT" ]
steps:
- uses: actions/checkout@v2

- name: Setup environment
run: echo "JAVA_HOME=${JAVA_HOME_8_X64}" | tee -a $GITHUB_ENV

- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: |
~/.m2/repository/
!~/.m2/repository/**/*-SNAPSHOT/
target/it-repo/
!target/it-repo/**/*-SNAPSHOT/
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}-gwt-${{ matrix.gwt }}
restore-keys: |
${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- name: Build with Maven
run: mvn -B -U -ntp verify --fail-at-end -DgwtVersion=${{ matrix.gwt }}
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

0 comments on commit 43477b4

Please sign in to comment.