Skip to content

Commit

Permalink
Move validation steps in separate jobs
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied committed Oct 26, 2022
1 parent 49016cd commit cee4700
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 33 deletions.
50 changes: 32 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
runs-on: ${{ matrix.platform }}

steps:

- name: Set up JDK for build and test
uses: actions/setup-java@v2
with:
Expand All @@ -26,25 +25,13 @@ jobs:
- name: Checkout security
uses: actions/checkout@v2

- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Package
uses: gradle/gradle-build-action@v2
with:
arguments: clean build -Dbuild.snapshot=false -x test -x integrationTest

- name: Test
- name: Clean Build and Test
uses: gradle/gradle-build-action@v2
with:
arguments: test integrationTest
arguments: clean build -Dbuild.snapshot=false
arguments: -x spotlessCheck # Don't check for style issues, enforced in Code Hygiene workflow
arguments: -x checkstyleMain # Don't check for style issues, enforced in Code Hygiene workflow
arguments: -x checkstyleTest # Don't check for style issues, enforced in Code Hygiene workflow

- name: Coverage
uses: codecov/codecov-action@v1
Expand All @@ -63,6 +50,33 @@ jobs:
if: always()
run: echo "Check the artifact ${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports for detailed test results"

integration-tests:
name: build
strategy:
fail-fast: false
matrix:
jdk: [17]
platform: ["ubuntu-latest", "windows-latest", "macos-latest"]
runs-on: ${{ matrix.platform }}

steps:
- name: Set up JDK for build and test
uses: actions/setup-java@v2
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: ${{ matrix.jdk }}

- name: Checkout security
uses: actions/checkout@v2

- name: Clean build and Test
uses: gradle/gradle-build-action@v2
with:
arguments: clean integrationTest -Dbuild.snapshot=false
arguments: -x spotlessCheck # Don't check for style issues, enforced in Code Hygiene workflow
arguments: -x checkstyleMain # Don't check for style issues, enforced in Code Hygiene workflow
arguments: -x checkstyleTest # Don't check for style issues, enforced in Code Hygiene workflow

backward-compatibility:
runs-on: ubuntu-latest
steps:
Expand Down
18 changes: 3 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ test {
}
retry {
failOnPassedAfterRetry = false
// maxRetries = 5
maxRetries = 5
}
jacoco {
excludes = [
Expand Down Expand Up @@ -278,20 +278,14 @@ sourceSets {
}
}

//add new task that runs integration tests
//add new task that runs integration tests, only runs when explictly called
task integrationTest(type: Test) {
description = 'Run integration tests.'
group = 'verification'
systemProperty "java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager"
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
retry {
failOnPassedAfterRetry = false
maxRetries = 2
maxFailures = 10
}
//run the integrationTest task after the test task
shouldRunAfter test

}

//run the integrationTest task before the check task
Expand Down Expand Up @@ -376,12 +370,6 @@ dependencies {
runtimeOnly 'org.apache.santuario:xmlsec:2.2.3'
runtimeOnly 'com.github.luben:zstd-jni:1.5.0-2'
runtimeOnly 'org.checkerframework:checker-qual:3.5.0'
// testRuntimeOnly 'io.netty:netty-tcnative:2.0.54.Final:windows-x86_64'
// runtimeOnly 'io.netty:netty-tcnative-boringssl-static:2.0.54.Final'
// testRuntimeOnly "io.netty:netty-all:${versions.netty}"
testRuntimeOnly 'io.netty:netty-tcnative-boringssl-static:2.0.54.Final:windows-x86_64'



implementation 'org.apache.commons:commons-lang3:3.4'
testImplementation "org.opensearch:common-utils:${common_utils_version}"
Expand Down

0 comments on commit cee4700

Please sign in to comment.