From a2a79404b81e138a651616dd7e2a1fa8b807399b Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Sun, 13 Sep 2020 12:28:35 -0400 Subject: [PATCH] GitHub Action (To retire Travis) (#2401) * feat: attempt at github action workflow * build: run on any push/branch (github action) * fix: drop 32bit and use proper windows variable * fix: add cache system for gradle * fix: only pushes (not prs) * fix: proper windows command * fix: bye bye travis (thanks for all the fish) * style: shorten name of lanes * style: this is jdk, not jvm --- .github/workflows/test.yml | 33 ++++++++++++++++++++++++++++ .travis.yml | 37 -------------------------------- scripts/travis-ci/clean-tests.sh | 13 ----------- scripts/travis-ci/run-tests.sh | 12 ----------- 4 files changed, 33 insertions(+), 62 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml delete mode 100755 scripts/travis-ci/clean-tests.sh delete mode 100755 scripts/travis-ci/run-tests.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..9d36faf5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +name: CI +on: [push] + +jobs: + build-and-test-with-Java-8-and-later: + name: Build/Test (JDK ${{ matrix.java }}, ${{ matrix.os }}) + strategy: + fail-fast: false + max-parallel: 10 + matrix: + os: [ubuntu-latest, macOS-latest, windows-latest] + java: [8, 9, 10, 11, 12, 13, 14] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + - uses: actions/checkout@v2 + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Build and test + run: ./gradlew.bat build shadowJar proguard + if: startsWith(matrix.os, 'windows') == true + - name: Build and test + run: ./gradlew build shadowJar proguard + if: startsWith(matrix.os, 'windows') != true \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 577b8e13..00000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -env: - global: - - TERM=dumb - - GROOVY_TURN_OFF_JAVA_WARNINGS=true - -language: java - -dist: trusty - -matrix: - include: - - os: linux - jdk: openjdk8 - - os: linux - jdk: oraclejdk8 - - os: linux - jdk: oraclejdk11 - - os: osx - osx_image: xcode9.2 - - os: windows - language: shell -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ - -install: - - chmod +x ./scripts/travis-ci/clean-tests.sh - - ./scripts/travis-ci/clean-tests.sh - -script: - - chmod +x ./scripts/travis-ci/run-tests.sh - - ./scripts/travis-ci/run-tests.sh - -branches: - only: - - master \ No newline at end of file diff --git a/scripts/travis-ci/clean-tests.sh b/scripts/travis-ci/clean-tests.sh deleted file mode 100755 index 086ce32c..00000000 --- a/scripts/travis-ci/clean-tests.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env sh - -if [ "$TRAVIS_OS_NAME" = "windows" ]; then - export GRADLE_OPTS=-Dorg.gradle.daemon=false - choco install jdk8 - export PATH=$PATH:"/c/Program Files/Java/jdk1.8.0_211/bin" - export JAVA_HOME="/c/Program Files/Java/jdk1.8.0_211" - ./gradlew.bat clean -else - ./gradlew clean -fi - -exit $? diff --git a/scripts/travis-ci/run-tests.sh b/scripts/travis-ci/run-tests.sh deleted file mode 100755 index a09b550f..00000000 --- a/scripts/travis-ci/run-tests.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env sh - -if [ "$TRAVIS_OS_NAME" = "windows" ]; then - export GRADLE_OPTS=-Dorg.gradle.daemon=false - export PATH=$PATH:"/c/Program Files/Java/jdk1.8.0_211/bin" - export JAVA_HOME="/c/Program Files/Java/jdk1.8.0_211" - ./gradlew.bat build shadowJar proguard -else - ./gradlew build shadowJar proguard -fi - -exit $?