Skip to content

Commit

Permalink
[WFLY-18502][WFLY-18498] adds MATRIX_OS allowing customization of tes…
Browse files Browse the repository at this point in the history
…t matrix OSes; adds support for optional quickstart-specific sh scripts to run before and after the tests"
  • Loading branch information
emmartins committed Oct 14, 2023
1 parent 5021e4c commit 839885a
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 4 deletions.
62 changes: 58 additions & 4 deletions .github/workflows/quickstart_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ on:
required: false
default: true
type: boolean
MATRIX_OS:
description: 'the OSes to be used on the test matrix, i.e. matrix.os'
required: false
default: '"ubuntu-latest", "windows-latest"'
type: string
SERVER_PROVISIONING_SERVER_HOST:
description: 'the server.host arg to be used when testing server provisioning with the mvn verify command'
required: false
Expand All @@ -34,14 +39,23 @@ concurrency:
cancel-in-progress: true

jobs:
Matrix-Setup:
runs-on: ubuntu-latest
outputs:
os: ${{ steps.setup-os-matrix.outputs.os }}
steps:
- id: setup-os-matrix
run: echo 'os=[${{ inputs.MATRIX_OS }}]' >> $GITHUB_OUTPUT

Test-build-default-matrix:
name: BUILD DEFAULT - JDK${{ matrix.jdk }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: Matrix-Setup
strategy:
fail-fast: false
matrix:
jdk: [11, 17]
os: [ubuntu-20.04, windows-latest]
os: ${{ fromJSON(needs.Matrix-Setup.outputs.os) }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -52,6 +66,16 @@ jobs:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: 'maven'
- name: Run before script
env:
FILE: "./quickstarts/.github/workflows/quickstart_${{ inputs.QUICKSTART_PATH }}_ci_before.sh"
run: |
if test -f $FILE;
then
chmod +x $FILE
bash $FILE
fi
shell: bash
- name: Build ${{ inputs.QUICKSTART_PATH }} Quickstart for Release
run: |
cd quickstarts
Expand Down Expand Up @@ -93,11 +117,21 @@ jobs:
cd ${{ inputs.QUICKSTART_PATH }}
mvn -U -B -fae clean package -Popenshift
shell: bash
- name: Run after script
env:
FILE: "./quickstarts/.github/workflows/quickstart_${{ inputs.QUICKSTART_PATH }}_ci_after.sh"
run: |
if test -f $FILE;
then
chmod +x $FILE
bash $FILE
fi
shell: bash
- uses: actions/upload-artifact@v3
if: failure()
with:
name: surefire-reports-JDK${{ matrix.jdk }}-${{ matrix.os }}
path: 'quickstarts/$QUICKSTART_PATH/**/surefire-reports/*.txt'
path: 'quickstarts/${{ env.QUICKSTART_PATH }}/**/surefire-reports/*.txt'

# Use the shared-wildfly-build workflow to have a consistent WildFly build. Note the branch names MUST match what
# is used in WildFly.
Expand All @@ -110,12 +144,12 @@ jobs:
Test-build-with-deps-matrix:
name: BUILD WITH DEPS - JDK${{ matrix.jdk }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: WildFly-build
needs: [Matrix-Setup, WildFly-build]
strategy:
fail-fast: false
matrix:
jdk: [11, 17]
os: [ubuntu-20.04, windows-latest]
os: ${{ fromJSON(needs.Matrix-Setup.outputs.os) }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -133,6 +167,16 @@ jobs:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: 'maven'
- name: Run before script
env:
FILE: "./quickstarts/.github/workflows/quickstart_${{ inputs.QUICKSTART_PATH }}_ci_before.sh"
run: |
if test -f $FILE;
then
chmod +x $FILE
bash $FILE
fi
shell: bash
- name: Build Quickstart for Release with built Server version
run: |
cd quickstarts
Expand Down Expand Up @@ -174,6 +218,16 @@ jobs:
cd ${{ inputs.QUICKSTART_PATH }}
mvn -U -B -fae clean package -Popenshift -Dversion.server=${{ needs.wildfly-build.outputs.wildfly-version }}
shell: bash
- name: Run after script
env:
FILE: "./quickstarts/.github/workflows/quickstart_${{ inputs.QUICKSTART_PATH }}_ci_after.sh"
run: |
if test -f $FILE;
then
chmod +x $FILE
bash $FILE
fi
shell: bash
- uses: actions/upload-artifact@v3
if: failure()
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/quickstart_helloworld_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ jobs:
with:
QUICKSTART_PATH: helloworld
TEST_PROVISIONED_SERVER: true
TEST_OPENSHIFT: false
MATRIX_OS: '"ubuntu-latest"'
2 changes: 2 additions & 0 deletions .github/workflows/quickstart_helloworld_ci_after.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo Goodbye World
2 changes: 2 additions & 0 deletions .github/workflows/quickstart_helloworld_ci_before.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
echo Hello World

0 comments on commit 839885a

Please sign in to comment.