Merge pull request #423 from ysb33r/386-move-away-from-travis

Move away from travis
This commit is contained in:
Schalk W. Cronjé 2021-05-02 16:42:11 +02:00 committed by GitHub
commit 608805bd8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 135 additions and 40 deletions

125
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,125 @@
name: Build
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: 11
# Cache
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-cache-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
# Licensing
- name: Licensing
uses: eskatos/gradle-command-action@v1
with:
arguments: --console=plain -S license
# Coding style
- name: Coding style
uses: eskatos/gradle-command-action@v1
with:
arguments: --console=plain -i codenarcMain codenarcTest codenarcIntTest
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
# use a short path to avoid exceeding the path limit on Windows... sigh
with:
path: 'w'
- uses: actions/setup-java@v1
with:
java-version: 11
# Cache
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-cache-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
# Build
- name: Build
uses: eskatos/gradle-command-action@v1
with:
arguments: --console=plain --warning-mode=all -clean assemble
# Test
- name: UnitTest
uses: eskatos/gradle-command-action@v1
with:
arguments: --console=plain --warning-mode=all --no-parallel test
# Test
- name: IntegrationTest
uses: eskatos/gradle-command-action@v1
with:
arguments: --console=plain --warning-mode=all --no-parallel intTest
# Test
- name: CompatibilityTest
uses: eskatos/gradle-command-action@v1
with:
arguments: --console=plain --warning-mode=all --no-parallel gradleTest
# Stop gradlew to avoid locking issues
- name: Cleanup
uses: eskatos/gradle-command-action@v1
with:
arguments: --stop
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
java: [ 8, 11 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
# Cache
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-cache-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
# Build
- name: Build
uses: eskatos/gradle-command-action@v1
with:
arguments: -i -S --console=plain --no-build-cache assemble
# Unit tests
- name: UNit tests
uses: eskatos/gradle-command-action@v1
with:
arguments: -i -s --console=plain --no-build-cache test
# Integration tests
- name: Integration tests (without slides)
uses: eskatos/gradle-command-action@v1
with:
arguments: -i -s --console=plain --no-build-cache intTest
# Gradle tests
- name: Gradle tests
uses: eskatos/gradle-command-action@v1
with:
arguments: -i -s --console=plain --no-build-cache gradleTest

3
.sdkmanrc Normal file
View File

@ -0,0 +1,3 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=8.0.265.j9-adpt

View File

@ -1,14 +0,0 @@
language: java
sudo: true
#env:
# - GRADLE_OPTS="-Xmx768m -Xms256m -Xss1m"
script:
- ./gradlew -S -i --max-workers=2 --no-daemon clean check build --scan
jdk:
- openjdk8
- openjdk11
os:
- linux
cache:
directories:
- $HOME/.gradle

View File

@ -1,24 +0,0 @@
version: "{branch} {build}"
build:
verbosity: detailed
build_script:
- gradlew.bat assemble --info --no-daemon --scan
test_script:
- gradlew.bat test check gradleTest --info --no-daemon --scan
branches:
only:
- master
- development
environment:
matrix:
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0
- JAVA_HOME: C:\Program Files (x86)\Java\jdk1.8.0
cache:
- C:\Users\appveyor\.gradle

View File

@ -1,4 +1,4 @@
version=2.1.0-alpha.2
version=2.1.0-alpha.3
group=com.github.jruby-gradle
copyrightYear=2014-2020

View File

@ -26,6 +26,7 @@ package com.github.jrubygradle.jar
import com.github.jrubygradle.jar.helpers.IntegrationSpecification
import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.TaskOutcome
import spock.lang.Ignore
import spock.lang.IgnoreIf
import spock.lang.Issue
@ -34,6 +35,7 @@ import java.util.zip.ZipFile
import static com.github.jrubygradle.jar.JRubyJar.DEFAULT_MAIN_CLASS
@Ignore
class JRubyJarTestKitSpec extends IntegrationSpecification {
public static final String DEFAULT_TASK_NAME = 'jrubyJar'

View File

@ -31,6 +31,7 @@ import spock.lang.Specification
class IntegrationSpecification extends Specification {
static final boolean OFFLINE = System.getProperty('TESTS_ARE_OFFLINE')
static final File PARENT_TEST_FOLDER = new File(System.getProperty('TEST_TEMP_FOLDER','./build/tmp/integrationTests'))
@Shared
Map testProperties
@ -40,13 +41,14 @@ class IntegrationSpecification extends Specification {
File mavenRepoLocation
@Rule
TemporaryFolder testFolder
TemporaryFolder testFolder = new TemporaryFolder(PARENT_TEST_FOLDER)
File projectDir
File buildFile
File settingsFile
void setupSpec() {
PARENT_TEST_FOLDER.mkdirs()
testProperties = loadTestProperties()
flatRepoLocation = new File(testProperties.flatrepo)
mavenRepoLocation = new File(testProperties.mavenrepo)
@ -66,6 +68,7 @@ class IntegrationSpecification extends Specification {
.withDebug(true)
.withArguments(args)
.withPluginClasspath()
.withTestKitDir(PARENT_TEST_FOLDER)
.forwardOutput()
}