Files
iot-dc3/.github/workflows/test.yml
dependabot[bot] e777764661 build(deps): bump actions/setup-java from 5.7.0 to 6.0.1
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5.7.0 to 6.0.1.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/b6effb05e454b25005698d916606bdc6ffcbf961...de7274f081f381c8f8158605e0321c36c376e2e6)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-20 19:03:31 +00:00

160 lines
4.8 KiB
YAML

name: Test
on:
workflow_call:
push:
branches: [ develop, main ]
pull_request:
branches: [ develop, main ]
permissions:
contents: read
pull-requests: read
concurrency:
group: test-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Fetch main baseline for spotless ratchet
# Shallow PR checkouts have no origin/main ref for ratchetFrom to diff against.
run: git fetch origin refs/heads/main:refs/remotes/origin/main --depth=1
- name: Set up JDK 21
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6
with:
distribution: liberica
java-version: 21
cache: maven
cache-dependency-path: "**/pom.xml"
- name: Run unit tests
run: |
set -euo pipefail
mvn -U -e -B -Dskip.integration.tests=true -Dcoverage.check.skip=true test --no-transfer-progress
- name: Upload surefire reports
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: surefire-reports
path: '**/target/surefire-reports/'
if-no-files-found: ignore
retention-days: 7
- name: Upload jacoco unit data
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: jacoco-unit-exec
path: '**/target/jacoco.exec'
if-no-files-found: ignore
retention-days: 7
integration:
name: Integration tests
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Fetch main baseline for spotless ratchet
# Shallow PR checkouts have no origin/main ref for ratchetFrom to diff against.
run: git fetch origin refs/heads/main:refs/remotes/origin/main --depth=1
- name: Set up JDK 21
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6
with:
distribution: liberica
java-version: 21
cache: maven
cache-dependency-path: "**/pom.xml"
- name: Verify docker availability
run: |
docker version
docker info
- name: Run integration tests
env:
TESTCONTAINERS_REUSE_ENABLE: "true"
run: |
set -euo pipefail
mvn -U -e -B -Dskip.unit.tests=true -Dcoverage.check.skip=true verify --no-transfer-progress
- name: Upload failsafe reports
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: failsafe-reports
path: '**/target/failsafe-reports/'
if-no-files-found: ignore
retention-days: 7
- name: Upload jacoco integration data
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: jacoco-it-exec
path: '**/target/jacoco-it.exec'
if-no-files-found: ignore
retention-days: 7
coverage:
name: Aggregated coverage
runs-on: ubuntu-latest
timeout-minutes: 30
needs:
- unit
- integration
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Fetch main baseline for spotless ratchet
# Shallow PR checkouts have no origin/main ref for ratchetFrom to diff against.
run: git fetch origin refs/heads/main:refs/remotes/origin/main --depth=1
- name: Set up JDK 21
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6
with:
distribution: liberica
java-version: 21
cache: maven
cache-dependency-path: "**/pom.xml"
- name: Download unit jacoco data
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: jacoco-unit-exec
path: ./
- name: Download integration jacoco data
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: jacoco-it-exec
path: ./
- name: Build aggregate coverage report
run: |
set -euo pipefail
mvn -U -e -B -pl dc3-coverage -am -Dskip.unit.tests=true -Dskip.integration.tests=true verify --no-transfer-progress
- name: Upload aggregate report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: jacoco-aggregate
path: dc3-coverage/target/site/jacoco-aggregate/
if-no-files-found: ignore
retention-days: 14