Skip to content

Commit

Permalink
Merge pull request #734 from emmartins/WFLY-18612
Browse files Browse the repository at this point in the history
[WFLY-18612] adds support for optional profile build tests; and cu…
  • Loading branch information
emmartins authored Oct 13, 2023
2 parents 5654384 + 031c525 commit 5021e4c
Show file tree
Hide file tree
Showing 14 changed files with 106 additions and 80 deletions.
69 changes: 35 additions & 34 deletions .github/workflows/project_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,46 +39,47 @@ jobs:
name: surefire-reports-JDK${{ matrix.jdk }}-${{ matrix.os }}
path: 'quickstarts/**/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.
WildFly-build:
uses: wildfly/wildfly/.github/workflows/shared-wildfly-build.yml@main
with:
wildfly-branch: ${{ github.base_ref }}
wildfly-repo: "wildfly/wildfly"

Test-build-with-deps-matrix:
name: BUILD WITH DEPS - JDK${{ matrix.jdk }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: WildFly-build
strategy:
fail-fast: false
matrix:
jdk: [11, 17]
os: [ubuntu-20.04, windows-latest]
steps:
- uses: actions/checkout@v4
with:
repository: wildfly/wildfly
ref: ${{ github.base_ref }}
path: wildfly
- uses: actions/checkout@v4
with:
path: quickstarts
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: 'maven'
- name: Build Server
run: |
cd wildfly
mvn -U -B -fae -DskipTests clean install
shell: bash
- name: Get Server Version
run: |
cd wildfly
echo "VERSION_SERVER=$(mvn -N org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
shell: bash
- name: Build Quickstarts Release with Server and BOMs Versions
run: |
cd quickstarts
mvn -U -B -fae clean install -Drelease -Dversion.server.bom=${{ env.VERSION_SERVER }} -Dversion.microprofile.bom=${{ env.VERSION_SERVER }} -Dversion.server.bootable-jar=${{ env.VERSION_SERVER }} -Dversion.server=${{ env.VERSION_SERVER }}
shell: bash
- uses: actions/upload-artifact@v3
if: failure()
with:
name: surefire-reports-JDK${{ matrix.jdk }}-${{ matrix.os }}
path: 'quickstarts/**/surefire-reports/*.txt'
- uses: actions/checkout@v4
with:
path: quickstarts
- uses: actions/download-artifact@v3
with:
name: wildfly-maven-repository
path: .
- name: Extract Maven Repo
shell: bash
run: tar -xzf wildfly-maven-repository.tar.gz -C ~
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: 'maven'
- name: Build Quickstarts Release with Server and BOMs Versions
run: |
cd quickstarts
mvn -U -B -fae clean install -Drelease -Dversion.server.bom=${{ needs.wildfly-build.outputs.wildfly-version }} -Dversion.microprofile.bom=${{ needs.wildfly-build.outputs.wildfly-version }} -Dversion.server.bootable-jar=${{ needs.wildfly-build.outputs.wildfly-version }} -Dversion.server=${{ needs.wildfly-build.outputs.wildfly-version }}
shell: bash
- uses: actions/upload-artifact@v3
if: failure()
with:
name: surefire-reports-JDK${{ matrix.jdk }}-${{ matrix.os }}
path: 'quickstarts/**/surefire-reports/*.txt'
2 changes: 1 addition & 1 deletion .github/workflows/quickstart_batch-processing_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: ./.github/workflows/quickstart_ci.yml
with:
QUICKSTART_PATH: batch-processing
MICROPROFILE: false
TEST_PROVISIONED_SERVER: true
79 changes: 49 additions & 30 deletions .github/workflows/quickstart_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,26 @@ on:
description: 'the path to the quickstart to test'
required: true
type: string
MICROPROFILE:
description: 'if the quickstart is a microprofile one'
required: true
TEST_PROVISIONED_SERVER:
description: 'if the quickstart support for provisioned-server profile should be tested'
required: false
default: false
type: boolean
TEST_BOOTABLE_JAR:
description: 'if the quickstart support for bootable jar profile should be tested'
required: false
default: false
type: boolean
TEST_OPENSHIFT:
description: 'if the quickstart support for openshift profile should be tested'
required: false
default: true
type: boolean
SERVER_PROVISIONING_SERVER_HOST:
description: 'the server.host arg to be used when testing server provisioning with the mvn verify command'
required: false
default: 'http://localhost:8080'
type: string

# Only run the latest job
concurrency:
Expand Down Expand Up @@ -43,7 +59,7 @@ jobs:
mvn -U -B -fae clean install -Drelease
shell: bash
- name: Build, run & test ${{ inputs.QUICKSTART_PATH }} Quickstart with provisioned-server profile
if: ${{ !inputs.MICROPROFILE }}
if: ${{ inputs.TEST_PROVISIONED_SERVER }}
run: |
cd quickstarts
cd ${{ inputs.QUICKSTART_PATH }}
Expand All @@ -52,12 +68,12 @@ jobs:
echo "Starting provisioned server..."
mvn -U -B -fae wildfly:start -DjbossHome=target/server -Dstartup-timeout=120
echo "Testing provisioned server..."
mvn -U -B -fae verify -Dserver.host=http://localhost:8080 -Pintegration-testing
mvn -U -B -fae verify -Dserver.host=${{ inputs.SERVER_PROVISIONING_SERVER_HOST }} -Pintegration-testing
echo "Shutting down provisioned server..."
mvn -U -B -fae wildfly:shutdown
shell: bash
- name: Build, run & test ${{ inputs.QUICKSTART_PATH }} Quickstart with bootable-jar profile
if: ${{ inputs.MICROPROFILE }}
if: ${{ inputs.TEST_BOOTABLE_JAR }}
run: |
cd quickstarts
cd ${{ inputs.QUICKSTART_PATH }}
Expand All @@ -66,11 +82,12 @@ jobs:
echo "Starting bootable jar..."
mvn -U -B -fae wildfly-jar:start -Djar-file-name=target/${{ inputs.QUICKSTART_PATH }}-bootable.jar -Dstartup-timeout=120
echo "Testing bootable jar..."
mvn -U -B -fae verify -Dserver.host=http://localhost:8080 -Pintegration-testing
mvn -U -B -fae verify -Dserver.host=${{ inputs.SERVER_PROVISIONING_SERVER_HOST }} -Pintegration-testing
echo "Shutting down bootable jar..."
mvn -U -B -fae wildfly-jar:shutdown
shell: bash
- name: Build ${{ inputs.QUICKSTART_PATH }} Quickstart with openshift profile
if: ${{ inputs.TEST_OPENSHIFT }}
run: |
cd quickstarts
cd ${{ inputs.QUICKSTART_PATH }}
Expand All @@ -82,78 +99,80 @@ jobs:
name: surefire-reports-JDK${{ matrix.jdk }}-${{ matrix.os }}
path: 'quickstarts/$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.
WildFly-build:
uses: wildfly/wildfly/.github/workflows/shared-wildfly-build.yml@main
with:
wildfly-branch: ${{ github.base_ref }}
wildfly-repo: "wildfly/wildfly"

Test-build-with-deps-matrix:
name: BUILD WITH DEPS - JDK${{ matrix.jdk }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: WildFly-build
strategy:
fail-fast: false
matrix:
jdk: [11, 17]
os: [ubuntu-20.04, windows-latest]
steps:
- uses: actions/checkout@v4
with:
repository: wildfly/wildfly
ref: ${{ github.base_ref }}
path: wildfly
- uses: actions/checkout@v4
with:
path: quickstarts
- uses: actions/download-artifact@v3
with:
name: wildfly-maven-repository
path: .
- name: Extract Maven Repo
shell: bash
run: tar -xzf wildfly-maven-repository.tar.gz -C ~
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: 'maven'
- name: Build Server
run: |
cd wildfly
mvn -U -B -fae -DskipTests clean install
shell: bash
- name: Get Server Version
run: |
cd wildfly
echo "VERSION_SERVER=$(mvn -N org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
shell: bash
- name: Build Quickstart for Release with built Server version
run: |
cd quickstarts
cd ${{ inputs.QUICKSTART_PATH }}
mvn -U -B -fae clean package -Drelease -Dversion.server=${{ env.VERSION_SERVER }}
mvn -U -B -fae clean package -Drelease -Dversion.server=${{ needs.wildfly-build.outputs.wildfly-version }}
shell: bash
- name: Build, run & test ${{ inputs.QUICKSTART_PATH }} Quickstart with provisioned-server profile, and built Server version
if: ${{ !inputs.MICROPROFILE }}
if: ${{ inputs.TEST_PROVISIONED_SERVER }}
run: |
cd quickstarts
cd ${{ inputs.QUICKSTART_PATH }}
echo "Building provisioned server..."
mvn -U -B -fae clean package -Pprovisioned-server -Dversion.server=${{ env.VERSION_SERVER }}
mvn -U -B -fae clean package -Pprovisioned-server -Dversion.server=${{ needs.wildfly-build.outputs.wildfly-version }}
echo "Starting provisioned server..."
mvn -U -B -fae wildfly:start -DjbossHome=target/server -Dstartup-timeout=120
echo "Testing provisioned server..."
mvn -U -B -fae verify -Dserver.host=http://localhost:8080 -Pintegration-testing
mvn -U -B -fae verify -Dserver.host=${{ inputs.SERVER_PROVISIONING_SERVER_HOST }} -Pintegration-testing
echo "Shutting down provisioned server..."
mvn -U -B -fae wildfly:shutdown
shell: bash
- name: Build, run & test ${{ inputs.QUICKSTART_PATH }} Quickstart with bootable-jar profile, and built Server version
if: ${{ inputs.MICROPROFILE }}
if: ${{ inputs.TEST_BOOTABLE_JAR }}
run: |
cd quickstarts
cd ${{ inputs.QUICKSTART_PATH }}
echo "Building bootable jar..."
mvn -U -B -fae clean package -Pbootable-jar -Dversion.server=${{ env.VERSION_SERVER }}
mvn -U -B -fae clean package -Pbootable-jar -Dversion.server=${{ needs.wildfly-build.outputs.wildfly-version }}
echo "Starting bootable jar..."
mvn -U -B -fae wildfly-jar:start -Djar-file-name=target/${{ inputs.QUICKSTART_PATH }}-bootable.jar -Dstartup-timeout=120
echo "Testing bootable jar..."
mvn -U -B -fae verify -Dserver.host=http://localhost:8080 -Pintegration-testing
mvn -U -B -fae verify -Dserver.host=${{ inputs.SERVER_PROVISIONING_SERVER_HOST }} -Pintegration-testing
echo "Shutting down bootable jar..."
mvn -U -B -fae wildfly-jar:shutdown
shell: bash
- name: Build ${{ inputs.QUICKSTART_PATH }} Quickstart with openshift profile, and built Server version
if: ${{ inputs.TEST_OPENSHIFT }}
run: |
cd quickstarts
cd ${{ inputs.QUICKSTART_PATH }}
mvn -U -B -fae clean package -Popenshift -Dversion.server=${{ env.VERSION_SERVER }}
mvn -U -B -fae clean package -Popenshift -Dversion.server=${{ needs.wildfly-build.outputs.wildfly-version }}
shell: bash
- uses: actions/upload-artifact@v3
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quickstart_helloworld-mdb_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: ./.github/workflows/quickstart_ci.yml
with:
QUICKSTART_PATH: helloworld-mdb
MICROPROFILE: false
TEST_PROVISIONED_SERVER: true
2 changes: 1 addition & 1 deletion .github/workflows/quickstart_helloworld_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: ./.github/workflows/quickstart_ci.yml
with:
QUICKSTART_PATH: helloworld
MICROPROFILE: false
TEST_PROVISIONED_SERVER: true
2 changes: 1 addition & 1 deletion .github/workflows/quickstart_kitchensink_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: ./.github/workflows/quickstart_ci.yml
with:
QUICKSTART_PATH: kitchensink
MICROPROFILE: false
TEST_PROVISIONED_SERVER: true
2 changes: 1 addition & 1 deletion .github/workflows/quickstart_microprofile-config_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: ./.github/workflows/quickstart_ci.yml
with:
QUICKSTART_PATH: microprofile-config
MICROPROFILE: true
TEST_BOOTABLE_JAR: true
2 changes: 1 addition & 1 deletion .github/workflows/quickstart_microprofile-jwt_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: ./.github/workflows/quickstart_ci.yml
with:
QUICKSTART_PATH: microprofile-jwt
MICROPROFILE: true
TEST_BOOTABLE_JAR: true
2 changes: 1 addition & 1 deletion .github/workflows/quickstart_microprofile-openapi_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: ./.github/workflows/quickstart_ci.yml
with:
QUICKSTART_PATH: microprofile-openapi
MICROPROFILE: true
TEST_BOOTABLE_JAR: true
2 changes: 1 addition & 1 deletion .github/workflows/quickstart_numberguess_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: ./.github/workflows/quickstart_ci.yml
with:
QUICKSTART_PATH: numberguess
MICROPROFILE: false
TEST_PROVISIONED_SERVER: true
2 changes: 1 addition & 1 deletion .github/workflows/quickstart_temperature-converter_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: ./.github/workflows/quickstart_ci.yml
with:
QUICKSTART_PATH: temperature-converter
MICROPROFILE: false
TEST_PROVISIONED_SERVER: true
2 changes: 1 addition & 1 deletion .github/workflows/quickstart_thread-racing_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: ./.github/workflows/quickstart_ci.yml
with:
QUICKSTART_PATH: thread-racing
MICROPROFILE: false
TEST_PROVISIONED_SERVER: true
9 changes: 6 additions & 3 deletions shared-doc/run-integration-tests-with-bootable-jar.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ $ mvn clean package -Pbootable-jar
$ mvn wildfly-jar:start -Djar-file-name=target/{artifactId}-bootable.jar
----

. Type the following command to run the `verify` goal with the `integration-testing` profile activated, and specifying the quickstart's URL using the `server.host` system property, which for a bootable jar by default is `http://localhost:8080`.
ifndef::server_provisioning_server_host[]
:server_provisioning_server_host: http://localhost:8080
endif::server_provisioning_server_host[]
. Type the following command to run the `verify` goal with the `integration-testing` profile activated, and specifying the quickstart's URL using the `server.host` system property, which for a bootable jar by default is `{server_provisioning_server_host}`.
+
[source,options="nowrap"]
[source,subs="attributes+",options="nowrap"]
----
$ mvn verify -Pintegration-testing -Dserver.host=http://localhost:8080
$ mvn verify -Pintegration-testing -Dserver.host={server_provisioning_server_host}
----

. Shutdown the {productName} bootable jar, this time using the {productName} Maven Jar Plugin too.
Expand Down
9 changes: 6 additions & 3 deletions shared-doc/run-integration-tests-with-provisioned-server.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ $ mvn clean package -Pprovisioned-server
$ mvn wildfly:start -DjbossHome=target/server
----

. Type the following command to run the `verify` goal with the `integration-testing` profile activated, and specifying the quickstart's URL using the `server.host` system property, which for a provisioned server by default is `http://localhost:8080`.
ifndef::server_provisioning_server_host[]
:server_provisioning_server_host: http://localhost:8080
endif::server_provisioning_server_host[]
. Type the following command to run the `verify` goal with the `integration-testing` profile activated, and specifying the quickstart's URL using the `server.host` system property, which for a provisioned server by default is `{server_provisioning_server_host}`.
+
[source,options="nowrap"]
[source,subs="attributes+",options="nowrap"]
----
$ mvn verify -Pintegration-testing -Dserver.host=http://localhost:8080
$ mvn verify -Pintegration-testing -Dserver.host={server_provisioning_server_host}
----

. Shutdown the {productName} provisioned server, this time using the {productName} Maven Plugin too.
Expand Down

0 comments on commit 5021e4c

Please sign in to comment.