Skip to content

Commit

Permalink
Split workflows for build and test
Browse files Browse the repository at this point in the history
and use batch file on Windows ...
  • Loading branch information
ascheman committed Feb 5, 2024
1 parent f84b91d commit db22d7b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 32 deletions.
35 changes: 4 additions & 31 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Gradle Build and Test
on:
pull_request:
push:
workflow_dispatch: {}
workflow_dispatch:
jobs:
gradle:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -43,34 +43,7 @@ jobs:
name: maven-repo
path: build/maven-repo

test-java-os-mix:
needs: gradle
strategy:
matrix:
os-version: [ ubuntu-latest, macos-14, windows-latest ]
java-version: [ 11, 17, 21 ]
runs-on: ${{ matrix.os-version }}
steps:
- uses: actions/checkout@v3
- name: Download Artifacts
uses: actions/download-artifact@master
with:
name: maven-repo
path: build/maven-repo
- uses: actions/setup-java@v3
- name: Trigger Test Matrix Workflow
uses: benc-uk/workflow-dispatch@v1
with:
distribution: temurin
# Always build with JDK 8 initially
java-version: ${{ matrix.java-version }}
- name: Execute integration test (on Unixes)
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
run: |
uname -a
./gradlew --version
./gradlew integrationTestOnly --scan
- name: Execute integration test (on Windows)
if: ${{ runner.os == 'Windows' }}
run: |
uname -a
./gradlew --version
./gradlew integrationTestOnly --scan
workflow: test-java-os-mix
37 changes: 37 additions & 0 deletions .github/workflows/test-java-os-mix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: HTML Sanity Check Matrix Test
on:
push:
workflow_dispatch: {}

jobs:
test-java-os-mix:
strategy:
matrix:
os-version: [ ubuntu-latest, macos-14, windows-latest ]
java-version: [ 8, 11, 17, 21 ]
runs-on: ${{ matrix.os-version }}
steps:
- uses: actions/checkout@v3
- name: Download Artifacts
uses: actions/download-artifact@master
with:
name: maven-repo
path: build/maven-repo
- uses: actions/setup-java@v3
with:
distribution: temurin
# Always build with JDK 8 initially
java-version: ${{ matrix.java-version }}
- name: Execute integration test (on Unixes)
# if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
run: |
uname -a
./gradlew --version
./gradlew integrationTestOnly --scan
# - name: Execute integration test (on Windows)
# if: ${{ runner.os == 'Windows' }}
# run: |
# uname -a
# gradlew --version
# gradlew integrationTestOnly --scan

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ tasks.register("integrationTestOnly") {
doLast {
def result = exec {
workingDir INTEGRATION_TEST_DIRECTORY
commandLine "./gradlew", "clean", "htmlSanityCheck", "-PhtmlSanityCheckVersion=${project.version}"
commandLine System.getProperty("os.name") == "Windows" ? "gradlew.bat" : "./gradlew", "clean", "htmlSanityCheck", "-PhtmlSanityCheckVersion=${project.version}"
}
logger.debug "Script output: $result"
File integrationTestDirectory = file(INTEGRATION_TEST_DIRECTORY)
Expand Down

0 comments on commit db22d7b

Please sign in to comment.