Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GH Action test matrix for OS/netty/transport #870

Merged
merged 3 commits into from
Oct 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/check_transport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check Matrix

on: [push, pull_request]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
transport: [native, nio]
exclude:
# excludes native on Windows (there's none)
- os: windows-latest
transport: native

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
# IF WE NEED TO TEST DIFFERENT VERSIONS OF NETTY, WE CAN ADD forceNettyVersion TO THE MATRIX
# run: ./gradlew check -PforceTransport=${{ matrix.transport }} -PforceNettyVersion=${{ matrix.netty }}
run: ./gradlew clean check -PforceTransport=${{ matrix.transport }}
22 changes: 0 additions & 22 deletions .github/workflows/gradle.yml

This file was deleted.

40 changes: 37 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,17 @@ ext {
testAddonVersion = reactorCoreVersion
assertJVersion = '3.6.1'

// Netty
nettyDefaultVersion = '4.1.43.Final'
if (!project.hasProperty("forceNettyVersion")) {
nettyVersion = nettyDefaultVersion
}
else {
nettyVersion = forceNettyVersion
println "Netty version defined from command line: ${forceNettyVersion}"
}

// Libraries
nettyVersion = '4.1.43.Final'
jacksonDatabindVersion = '2.5.1'

// Testing
Expand Down Expand Up @@ -203,6 +212,7 @@ configure(rootProject) { project ->
println 'Bamboo CI detected, avoiding use of mavenLocal()'
}
maven { url 'https://repo.spring.io/libs-snapshot' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
maven { url 'https://repo.spring.io/libs-milestone' }
maven { url 'https://repo.spring.io/libs-release' }
Expand Down Expand Up @@ -242,8 +252,32 @@ configure(rootProject) { project ->

compile "io.netty:netty-handler:${nettyVersion}"
compile "io.netty:netty-codec-http:${nettyVersion}"
compile "io.netty:netty-transport-native-epoll:${nettyVersion}:linux-x86_64"
optional "io.netty:netty-transport-native-kqueue:${nettyVersion}"

//transport resolution: typical build forces epoll but not kqueue transitively
//on the other hand, if we want to make transport-specific tests, we'll make all
// native optional at compile time and add correct native/nio to testRuntime
if (project.hasProperty("forceTransport")) {
//so that the main code compiles
optional "io.netty:netty-transport-native-epoll:${nettyVersion}"
optional "io.netty:netty-transport-native-kqueue:${nettyVersion}"
//now we explicitly add correctly qualified native, or do nothing if we want to test NIO
if (forceTransport == "native") {
if (osdetector.os == "osx") {
testRuntime "io.netty:netty-transport-native-kqueue:${nettyVersion}${os_suffix}"
}
else if (osdetector.os == "linux") {
testRuntime "io.netty:netty-transport-native-epoll:${nettyVersion}${os_suffix}"
}
}
else if (forceTransport != "nio") {
throw new InvalidUserDataException("invalid -PforceTranport option " + forceTransport + ", should be native|nio")
}
}
else {
//classic build to be distributed
compile "io.netty:netty-transport-native-epoll:${nettyVersion}:linux-x86_64"
optional "io.netty:netty-transport-native-kqueue:${nettyVersion}"
}

// Testing
testCompile "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
Expand Down