2020-06-17 10:48:08 -04:00
name : "Build"
2023-12-14 10:36:07 -05:00
on :
push :
pull_request :
workflow_dispatch :
inputs :
2024-01-08 10:27:47 -05:00
examplesRepo :
2023-12-14 10:36:07 -05:00
description : 'The examples repo to use'
required : true
default : 'apache/activemq-artemis-examples'
type : string
examplesRepoBranch :
description : 'Branch in examples repo'
required : true
default : 'development'
type : string
env :
2024-01-08 10:27:47 -05:00
EXAMPLES_REPO : ${{ inputs.examplesRepo || 'apache/activemq-artemis-examples' }}
2023-12-14 10:36:07 -05:00
EXAMPLES_BRANCH : ${{ inputs.examplesRepoBranch || 'development' }}
2020-06-17 10:48:08 -04:00
jobs :
2021-08-24 10:12:10 -04:00
test :
name : Test (${{ matrix.java }})
2024-02-13 06:46:19 -05:00
runs-on : ubuntu-22.04
2020-06-17 10:48:08 -04:00
strategy :
fail-fast : false
matrix :
2024-07-01 04:43:50 -04:00
java : [ 11 , 17 , 21 , 22 ]
2020-06-17 10:48:08 -04:00
steps :
2024-02-13 06:46:19 -05:00
- uses : actions/checkout@v4
2023-12-14 10:36:07 -05:00
with :
path : activemq-artemis
2021-10-13 10:43:17 -04:00
- name : Cache Maven Local Repo
if : ${{ !startsWith(github.ref, 'refs/tags/') }}
2024-02-13 06:46:19 -05:00
uses : actions/cache@v4
2020-06-17 10:48:08 -04:00
with :
path : |
2022-07-01 07:32:49 -04:00
~/.m2/repository/
2023-12-14 10:36:07 -05:00
key : ${{ runner.os }}-mvn-${{ hashFiles('activemq-artemis/**/pom.xml') }}
2020-06-17 10:48:08 -04:00
restore-keys : |
2022-07-01 07:32:49 -04:00
${{ runner.os }}-mvn-
2020-06-17 10:48:08 -04:00
- name : Install JDK ${{ matrix.java }}
2024-02-13 06:46:19 -05:00
uses : actions/setup-java@v4
2020-06-17 10:48:08 -04:00
with :
java-version : ${{ matrix.java }}
2021-09-24 12:06:48 -04:00
distribution : 'temurin'
2020-06-17 10:48:08 -04:00
# use 'install' so smoke-tests will work
# By setting anything to org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED we are disabling libaio loading on the testsuite
2021-08-24 10:12:10 -04:00
- name : Fast Tests
run : |
2023-12-14 10:36:07 -05:00
cd activemq-artemis
2023-07-11 11:35:45 -04:00
mvn -s .github/maven-settings.xml -Dorg.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED=AnythingNotNull -Pfast-tests -Pcompatibility-tests install
2021-08-24 10:12:10 -04:00
2022-07-01 07:32:49 -04:00
- name : Clean Up Before Caching
run : |
rm -rf ~/.m2/repository/org/apache/activemq/tests
rm -rf ~/.m2/repository/org/apache/activemq/examples
if [ -d ~/.m2/repository/org/apache/activemq ]; then find ~/.m2/repository/org/apache/activemq -name "*-SNAPSHOT" -type d -prune -exec rm -r '{}' \; ; fi
2021-08-24 10:12:10 -04:00
2024-06-21 09:05:06 -04:00
- name : Archive Test Logs
if : failure()
uses : actions/upload-artifact@v4
with :
name : surefire-reports-jdk-${{ matrix.java }}
path : activemq-artemis/**/target/surefire-reports/*
retention-days : 10
2021-08-24 10:12:10 -04:00
checks :
name : Checks (${{ matrix.java }})
2024-02-13 06:46:19 -05:00
runs-on : ubuntu-22.04
2021-08-24 10:12:10 -04:00
strategy :
fail-fast : false
matrix :
2024-07-01 04:43:50 -04:00
java : [ 11 , 17 , 21 , 22 ]
2021-08-24 10:12:10 -04:00
steps :
2024-02-13 06:46:19 -05:00
- uses : actions/checkout@v4
2023-12-14 10:36:07 -05:00
with :
path : activemq-artemis
2021-10-13 10:43:17 -04:00
- name : Cache Maven Local Repo
if : ${{ !startsWith(github.ref, 'refs/tags/') }}
2024-02-13 06:46:19 -05:00
uses : actions/cache@v4
2021-08-24 10:12:10 -04:00
with :
path : |
2022-07-01 07:32:49 -04:00
~/.m2/repository/
2023-12-14 10:36:07 -05:00
key : ${{ runner.os }}-mvn-${{ hashFiles('activemq-artemis/**/pom.xml') }}
2021-08-24 10:12:10 -04:00
restore-keys : |
2022-07-01 07:32:49 -04:00
${{ runner.os }}-mvn-
2021-08-24 10:12:10 -04:00
- name : Install JDK ${{ matrix.java }}
2024-02-13 06:46:19 -05:00
uses : actions/setup-java@v4
2021-08-24 10:12:10 -04:00
with :
java-version : ${{ matrix.java }}
2021-09-24 12:06:48 -04:00
distribution : 'temurin'
2021-08-24 10:12:10 -04:00
2023-12-14 10:36:07 -05:00
- name : Checkout Artemis Examples Repo
2024-02-13 06:46:19 -05:00
uses : actions/checkout@v4
2023-12-14 10:36:07 -05:00
with :
repository : ${{ env.EXAMPLES_REPO }}
ref : ${{ env.EXAMPLES_BRANCH }}
path : activemq-artemis-examples
2020-09-01 10:30:42 -04:00
- name : Build Main
run : |
2023-12-14 10:36:07 -05:00
cd activemq-artemis
2022-09-02 12:29:25 -04:00
mvn -s .github/maven-settings.xml -DskipTests -Derrorprone -Pdev -Pjmh install
2021-03-04 13:35:45 -05:00
2023-12-14 10:36:07 -05:00
- name : Set Examples Version to Artemis Version
run : |
cd activemq-artemis
CURRENT_ARTEMIS_BUILD_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "Current Artemis version: ${CURRENT_ARTEMIS_BUILD_VERSION}"
cd ../activemq-artemis-examples
./scripts/update-examples-version.sh ${CURRENT_ARTEMIS_BUILD_VERSION}
2021-08-17 06:28:20 -04:00
- name : Build Examples (JDK11 / -Prelease)
if : matrix.java == '11'
2020-06-17 10:48:08 -04:00
run : |
2023-12-14 10:36:07 -05:00
cd activemq-artemis-examples
mvn -s ../activemq-artemis/.github/maven-settings.xml install -Prelease
2020-06-17 10:48:08 -04:00
2021-08-17 06:28:20 -04:00
- name : Build Examples (JDK >11 / -Pexamples,noRun)
if : matrix.java != '11'
2021-03-04 13:35:45 -05:00
run : |
2023-12-14 10:36:07 -05:00
cd activemq-artemis-examples
mvn -s ../activemq-artemis/.github/maven-settings.xml install -Pexamples,noRun
2021-04-08 18:43:46 -04:00
2021-08-17 06:28:20 -04:00
- name : Javadoc Check (JDK11 / -Prelease)
if : matrix.java == '11'
2021-04-08 18:43:46 -04:00
run : |
2023-12-14 10:36:07 -05:00
cd activemq-artemis
2022-06-29 12:49:30 -04:00
mvn -s .github/maven-settings.xml javadoc:javadoc -Prelease -DskipWebsiteDocGeneration=true -DskipWebsiteJavadocGeneration=true
2021-06-02 11:58:25 -04:00
2021-08-17 06:28:20 -04:00
- name : Javadoc Check (JDK >11)
if : matrix.java != '11'
2021-06-02 11:58:25 -04:00
run : |
2023-12-14 10:36:07 -05:00
cd activemq-artemis
2021-08-17 12:56:41 -04:00
mvn -s .github/maven-settings.xml javadoc:javadoc
2022-06-29 12:49:30 -04:00
- name : Website Content Check (JDK11 only / -Prelease)
if : matrix.java == '11'
run : |
2023-12-14 10:36:07 -05:00
cd activemq-artemis
2022-06-29 12:49:30 -04:00
mvn -s .github/maven-settings.xml clean install -DskipTests -Prelease -am -pl "artemis-website"
2022-07-01 07:32:49 -04:00
- name : Clean Up Before Caching
run : |
rm -rf ~/.m2/repository/org/apache/activemq/tests
rm -rf ~/.m2/repository/org/apache/activemq/examples
if [ -d ~/.m2/repository/org/apache/activemq ]; then find ~/.m2/repository/org/apache/activemq -name "*-SNAPSHOT" -type d -prune -exec rm -r '{}' \; ; fi