mirror of
https://gitee.com/pnoker/iot-dc3.git
synced 2026-11-02 03:01:52 +08:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.3.1 to 7.0.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/34e114876b0b11c390a56381ad16ebd13914f8d5...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
147 lines
4.1 KiB
YAML
147 lines
4.1 KiB
YAML
name: Test
|
|
|
|
on:
|
|
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: Set up JDK 21
|
|
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9
|
|
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: Set up JDK 21
|
|
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9
|
|
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: Set up JDK 21
|
|
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9
|
|
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
|