NO-JIRA: split various checks out to their own sub jobs on GHA

- Ensures tests start and complete as fast as possible, speeding things up overall.
- Makes the checks happen earlier, and doesnt prevent the tests running if they fail, and vice versa.

Also tweaks build and cache config to avoid caching unintended build output as it has been.
This commit is contained in:
Robbie Gemmell 2021-08-24 15:12:10 +01:00 committed by clebertsuconic
parent 5a1449d812
commit 20e66a2063
1 changed files with 42 additions and 7 deletions

View File

@ -3,7 +3,8 @@ name: "Build"
on: [push, pull_request, workflow_dispatch] on: [push, pull_request, workflow_dispatch]
jobs: jobs:
build: test:
name: Test (${{ matrix.java }})
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
strategy: strategy:
fail-fast: false fail-fast: false
@ -17,9 +18,11 @@ jobs:
path: | path: |
~/.m2/repository ~/.m2/repository
!~/.m2/repository/org/apache/activemq/artemis-* !~/.m2/repository/org/apache/activemq/artemis-*
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} !~/.m2/repository/org/apache/activemq/*-artemis
!~/.m2/repository/org/apache/activemq/examples
key: ${{ runner.os }}-maven-test-${{ hashFiles('**/pom.xml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-maven- ${{ runner.os }}-maven-test-
- name: Install JDK ${{ matrix.java }} - name: Install JDK ${{ matrix.java }}
uses: actions/setup-java@v2 uses: actions/setup-java@v2
@ -28,23 +31,55 @@ jobs:
distribution: 'adopt' distribution: 'adopt'
# use 'install' so smoke-tests will work # use 'install' so smoke-tests will work
# use '-Pextra-tests' to ensure extra-tests compiles even though they won't actually run
# By setting anything to org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED we are disabling libaio loading on the testsuite # 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: |
mvn -s .github/maven-settings.xml -Dorg.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED=AnythingNotNull -Pfast-tests -Ptests-CI install
checks:
name: Checks (${{ matrix.java }})
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
java: [ 8, 11, 16 ]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.m2/repository
!~/.m2/repository/org/apache/activemq/artemis-*
!~/.m2/repository/org/apache/activemq/*-artemis
!~/.m2/repository/org/apache/activemq/examples
key: ${{ runner.os }}-maven-checks-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-checks-
${{ runner.os }}-maven-test-
- name: Install JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
- name: Build Main - name: Build Main
run: | run: |
mvn -s .github/maven-settings.xml -Dorg.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED=AnythingNotNull -Derrorprone -Pdev -Pfast-tests -Pextra-tests -Ptests-CI -Pjmh install mvn -s .github/maven-settings.xml -DskipTests -Derrorprone -Pdev -Pextra-tests -Pjmh install
- name: Build Examples (JDK8 / -Prelease) - name: Build Examples (JDK8 / -Prelease)
if: matrix.java == '8' if: matrix.java == '8'
run: | run: |
cd examples cd examples
mvn -s ../.github/maven-settings.xml install -Prelease mvn -s ../.github/maven-settings.xml verify -Prelease
- name: Build Examples (JDK 11+ / -Pexamples,noRun) - name: Build Examples (JDK 11+ / -Pexamples,noRun)
if: matrix.java != '8' if: matrix.java != '8'
run: | run: |
cd examples cd examples
mvn -s ../.github/maven-settings.xml install -Pexamples,noRun mvn -s ../.github/maven-settings.xml verify -Pexamples,noRun
- name: Javadoc Check (JDK8 / -Prelease) - name: Javadoc Check (JDK8 / -Prelease)
if: matrix.java == '8' if: matrix.java == '8'