166 lines
5.5 KiB
YAML
166 lines
5.5 KiB
YAML
name: "Build"
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
inputs:
|
|
examplesRepo:
|
|
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:
|
|
EXAMPLES_REPO: ${{ inputs.examplesRepo || 'apache/activemq-artemis-examples' }}
|
|
EXAMPLES_BRANCH: ${{ inputs.examplesRepoBranch || 'development' }}
|
|
|
|
|
|
jobs:
|
|
test:
|
|
name: Test (${{ matrix.java }})
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
java: [ 11, 17, 21, 22 ]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
path: activemq-artemis
|
|
|
|
- name: Cache Maven Local Repo
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.m2/repository/
|
|
key: ${{ runner.os }}-mvn-${{ hashFiles('activemq-artemis/**/pom.xml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-mvn-
|
|
|
|
- name: Install JDK ${{ matrix.java }}
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: ${{ matrix.java }}
|
|
distribution: 'temurin'
|
|
|
|
# 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
|
|
- name: Fast Tests
|
|
run: |
|
|
cd activemq-artemis
|
|
mvn -s .github/maven-settings.xml -Dorg.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED=AnythingNotNull -Pfast-tests -Pcompatibility-tests install
|
|
|
|
- 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
|
|
|
|
- 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
|
|
|
|
checks:
|
|
name: Checks (${{ matrix.java }})
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
java: [ 11, 17, 21, 22 ]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
path: activemq-artemis
|
|
|
|
- name: Cache Maven Local Repo
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.m2/repository/
|
|
key: ${{ runner.os }}-mvn-${{ hashFiles('activemq-artemis/**/pom.xml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-mvn-
|
|
|
|
- name: Install JDK ${{ matrix.java }}
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: ${{ matrix.java }}
|
|
distribution: 'temurin'
|
|
|
|
- name: Checkout Artemis Examples Repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: ${{ env.EXAMPLES_REPO }}
|
|
ref: ${{ env.EXAMPLES_BRANCH }}
|
|
path: activemq-artemis-examples
|
|
|
|
- name: Build Main (JDK11 / -Prelease)
|
|
if: matrix.java == '11'
|
|
run: |
|
|
cd activemq-artemis
|
|
mvn -s .github/maven-settings.xml -DskipTests -Derrorprone -Pdev -Prelease -Dgpg.skip install
|
|
|
|
- name: Build Main (JDK >11)
|
|
if: matrix.java != '11'
|
|
run: |
|
|
cd activemq-artemis
|
|
mvn -s .github/maven-settings.xml -DskipTests -Derrorprone -Pdev -Pjmh install
|
|
|
|
- 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}
|
|
|
|
- name: Build Examples (JDK11 / -Prelease)
|
|
if: matrix.java == '11'
|
|
run: |
|
|
cd activemq-artemis-examples
|
|
mvn -s ../activemq-artemis/.github/maven-settings.xml install -Prelease
|
|
|
|
- name: Build Examples (JDK >11 / -Pexamples,noRun)
|
|
if: matrix.java != '11'
|
|
run: |
|
|
cd activemq-artemis-examples
|
|
mvn -s ../activemq-artemis/.github/maven-settings.xml install -Pexamples,noRun
|
|
|
|
- name: Javadoc Check (JDK11 / -Prelease)
|
|
if: matrix.java == '11'
|
|
run: |
|
|
cd activemq-artemis
|
|
mvn -s .github/maven-settings.xml javadoc:javadoc -Prelease -DskipWebsiteDocGeneration=true -DskipWebsiteJavadocGeneration=true
|
|
|
|
- name: Javadoc Check (JDK >11)
|
|
if: matrix.java != '11'
|
|
run: |
|
|
cd activemq-artemis
|
|
mvn -s .github/maven-settings.xml javadoc:javadoc
|
|
|
|
- name: Website Content Check (JDK11 only / -Prelease)
|
|
if: matrix.java == '11'
|
|
run: |
|
|
cd activemq-artemis
|
|
mvn -s .github/maven-settings.xml clean install -DskipTests -Prelease -am -pl "artemis-website"
|
|
|
|
- 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
|