Skip to content

Sync back

Sync back #1960

name: Run integration tests
on:
workflow_dispatch:
push:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'
pull_request:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
persistence:
strategy:
fail-fast: false
matrix:
project: [persistence-it-hibernate]
parallel: [0, 2]
pre-start: [false, true]
java: [25]
include:
- project: persistence-it-eclipselink
parallel: 2
pre-start: true
java: 25
name: "persistence (${{matrix.project}}, ${{matrix.parallel}}, ${{matrix.pre-start}}, ${{matrix.java}})"
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }}
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- parallel:
- name: Set up JDK
uses: actions/setup-java@v6
with:
distribution: temurin
java-version: ${{ matrix.java }}
- name: Cache Maven
uses: actions/cache@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mvn-it-build-persistence-${{ matrix.project }}-${{ hashFiles('**/pom.xml') }}
- name: Docker Image Cache Restore
id: docker-image-cache-restore
uses: ./.github/actions/docker-image-cache/restore
with:
# This cache could always change however because docker images can be changed remotely if the version is not fixated
# As a compromise it utilizes the hash of the pom files because when the dependencies stay the same
# the images should also be roughly the same
key: ${{ runner.os }}-it-docker-images-persistence-${{ matrix.project }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-it-docker-images-persistence-${{ matrix.project }}-
- name: Setup Buildx
id: docker-image-cache-setup-buildx
uses: ./.github/actions/docker-image-cache/setup-buildx
- name: Test
run: |
./mvnw -B test \
-pl "demos/advanced-demo/integration-tests/${{ matrix.project }}" -am \
-T2C \
-P run-it \
-Dchecks.disable=true \
-Dlicense.skip \
${{ matrix.pre-start && '-Dtci.infra-pre-start.enabled=1 ' || '' }} \
${{ matrix.parallel > 0 && format('-Djunit.jupiter.execution.parallel.enabled=true -Djunit.jupiter.execution.parallel.mode.default=concurrent -Djunit.jupiter.execution.parallel.mode.classes.default=concurrent -Djunit.jupiter.execution.parallel.config.strategy=fixed -Djunit.jupiter.execution.parallel.config.fixed.parallelism=2 -Djunit.jupiter.execution.parallel.config.fixed.max-pool-size={0} ', matrix.parallel) || '' }}
env:
ACTIONS_RUNTIME_TOKEN: ${{ steps.docker-image-cache-setup-buildx.outputs.ACTIONS_RUNTIME_TOKEN }}
ACTIONS_RESULTS_URL: ${{ steps.docker-image-cache-setup-buildx.outputs.ACTIONS_RESULTS_URL }}
- name: Show images
run: docker image ls
- name: Docker Image Cache Save
uses: ./.github/actions/docker-image-cache/save
with:
key: ${{ steps.docker-image-cache-restore.outputs.key }}
cache-hit: ${{ steps.docker-image-cache-restore.outputs.cache-hit }}
selenium:
strategy:
fail-fast: false
matrix:
project: [webapp-it]
parallel: [0, 2]
pre-start: [false, true]
java: [25]
jacoco: [false]
# Dedicated build with JaCoCo
include:
- project: webapp-it
parallel: 2
pre-start: true
java: 25
jacoco: true
name: "selenium (${{matrix.project}}, ${{matrix.parallel }}, ${{matrix.pre-start}}, ${{matrix.java}}${{ matrix.jacoco && ', JaCoCo' || '' }})"
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }}
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- parallel:
- name: Set up JDK
uses: actions/setup-java@v6
with:
distribution: temurin
java-version: ${{ matrix.java }}
- name: Cache Maven
uses: actions/cache@v6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-mvn-it-build-selenium-${{ matrix.project }}-${{ hashFiles('**/pom.xml') }}
- name: Docker Image Cache Restore
id: docker-image-cache-restore
uses: ./.github/actions/docker-image-cache/restore
with:
# This cache could always change however because docker images can be changed remotely if the version is not fixated
# As a compromise it utilizes the hash of the pom files because when the dependencies stay the same
# the images should also be roughly the same
key: ${{ runner.os }}-it-docker-images-selenium-${{ matrix.project }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-it-docker-images-selenium-${{ matrix.project }}-
- name: Setup Buildx
id: docker-image-cache-setup-buildx
uses: ./.github/actions/docker-image-cache/setup-buildx
- name: Report CPU details
run: |
cat /proc/cpuinfo | grep -P '^model name' | uniq
cat /proc/cpuinfo | grep -P '^flags' | uniq
- name: Test
run: |
# Differentiate cache between AVX microcode used by Java (until https://github.com/xdev-software/tci/issues/688 is fixed)
java_useavx=$(java -XX:+PrintFlagsFinal -version 2> /dev/null | awk '/UseAVX/ {print $4}')
echo "Java UseAVX: ${java_useavx}"
./mvnw -B test \
-pl "demos/advanced-demo/integration-tests/${{ matrix.project }}" -am \
-T2C \
-P run-it${{ matrix.jacoco && ',jacoco' || '' }} \
-Dlicense.skip \
-Dtci.image-build.delete-on-exit=true \
-Dtci.image-build.cache-from="type=gha,scope=§image" \
-Dtci.image-build.cache-to="type=gha,mode=max,scope=§image" \
-Dtci.image-build.tci-demo-webapp.cache-from="type=gha,scope=§image-j_avx${java_useavx}${{ matrix.jacoco && '-jacoco' || '' }}" \
-Dtci.image-build.tci-demo-webapp.cache-to="type=gha,mode=max,scope=§image-j_avx${java_useavx}${{ matrix.jacoco && '-jacoco' || '' }}" \
${{ matrix.pre-start && '-Dtci.infra-pre-start.enabled=1 ' || '' }} \
${{ matrix.parallel > 0 && format('-Djunit.jupiter.execution.parallel.enabled=true -Djunit.jupiter.execution.parallel.mode.default=concurrent -Djunit.jupiter.execution.parallel.mode.classes.default=concurrent -Djunit.jupiter.execution.parallel.config.strategy=fixed -Djunit.jupiter.execution.parallel.config.fixed.parallelism=2 -Djunit.jupiter.execution.parallel.config.fixed.max-pool-size={0} ', matrix.parallel) || '' }}
env:
ACTIONS_RUNTIME_TOKEN: ${{ steps.docker-image-cache-setup-buildx.outputs.ACTIONS_RUNTIME_TOKEN }}
ACTIONS_RESULTS_URL: ${{ steps.docker-image-cache-setup-buildx.outputs.ACTIONS_RESULTS_URL }}
- name: Show images
run: docker image ls
- name: Docker Image Cache Save
uses: ./.github/actions/docker-image-cache/save
with:
key: ${{ steps.docker-image-cache-restore.outputs.key }}
cache-hit: ${{ steps.docker-image-cache-restore.outputs.cache-hit }}
background: true
- name: Upload videos of test failures
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: test-fail-videos-${{ matrix.java }}-${{ matrix.project }}-${{ matrix.parallel }}-${{ matrix.pre-start }}
path: demos/advanced-demo/integration-tests/${{ matrix.project }}/target/records
if-no-files-found: ignore
- name: Aggregate WebApp JaCoCo report
if: ${{ matrix.jacoco && success() }}
# Important: Also run compile (if not already done) so that we have all class files - otherwise the report will be incomplete
run: |
./mvnw -B compile jacoco-aggregator:report-aggregate-all -pl webapp -am -T2C
working-directory: demos/advanced-demo
- name: Upload WebApp JaCoCo report
if: ${{ matrix.jacoco && success() }}
uses: actions/upload-artifact@v7
with:
name: webapp-jacoco-report-${{ matrix.java }}-${{ matrix.project }}-${{ matrix.parallel }}-${{ matrix.pre-start }}
path: demos/advanced-demo/target/site/jacoco-aggregate
if-no-files-found: ignore
- name: Wait for async jobs to finish
wait-all: