code-maven-QA-integration-[feature/GH-19-exec-maven-jansi-issue]=>[develop] #43
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# The name of the workflow | |
name: code-maven-QA-integration | |
# The name of the workflow run | |
run-name: "${{ github.workflow }}-[${{ github.head_ref || github.ref_name }}]=>[${{ github.base_ref }}]" | |
# Concurrency configuration | |
concurrency: | |
# The concurrency group for this workflow | |
group: "${{ github.workflow }}-[${{ github.head_ref || github.ref_name }}]=>[${{ github.base_ref }}]" | |
# Cancel all previous runs in progress | |
cancel-in-progress: true | |
# Events that trigger the workflow | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
INTEGRATION_COVERAGE_THRESHOLD: | |
description: | | |
The minimum coverage threshold to pass the integration tests, for example 80 | |
'DEFAULT' uses the value set in github_config.yml "integration.coverage.threshold". | |
required: false | |
default: DEFAULT | |
# Automatically run the workflow on pull_request events | |
pull_request: | |
types: [ opened, edited, labeled, synchronize, ready_for_review, reopened ] | |
paths: | |
- 'code/**' | |
- '.github/workflows/code*' | |
# Environment variables available to all jobs and steps in this workflow | |
env: | |
WORKFLOW_VERSION: 1.0.0 | |
MAVEN_OPTS: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# integration-tests | |
integration-tests: | |
# The name of the job | |
name: integration-tests | |
# The type of runner that the job will run on | |
runs-on: ubuntu-20.04 | |
# Conditions to run the job | |
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.draft == false }} | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# checkout | |
- name: checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# config | |
- name: config | |
id: config | |
uses: ./.github/actions/config-resolver | |
with: | |
create-annotations: true | |
files: | | |
github_config.yml | |
input-vars: "${{ toJSON(github.event.inputs) }}" # it injects all workflows inputs | |
# setup-maven-cache | |
- name: setup-maven-cache | |
uses: actions/cache@v4 | |
continue-on-error: true | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
# setup-asdf-cache | |
- name: setup-asdf-cache | |
uses: actions/cache@v4 | |
continue-on-error: true | |
with: | |
path: ~/.asdf/data | |
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }} | |
restore-keys: | | |
${{ runner.os }}-asdf- | |
# save-tool-versions-content | |
- name: save-tool-versions-content | |
run: | | |
{ | |
echo "TOOL_VERSIONS<<EOF" | |
cat code/.tool-versions | |
echo "EOF" | |
} >> "$GITHUB_ENV" | |
# asdf-install | |
- name: asdf-install | |
id: asdf-install | |
uses: asdf-vm/actions/install@v3 | |
with: | |
tool_versions: ${{ env.TOOL_VERSIONS }} | |
# set-java-home | |
- name: set-java-home | |
id: set-java-home | |
run: | | |
# set-java-home | |
echo "::group::+++ set-java-home +++" | |
# Set JAVA_HOME | |
JAVA_HOME="$(asdf where java)" | |
echo "JAVA_HOME=$JAVA_HOME" | |
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
echo "::endgroup::" | |
# mvn-clean-verify | |
- name: mvn-clean-verify | |
id: mvn-clean-verify | |
working-directory: code | |
run: | | |
# mvn-clean-verify | |
echo "::group::+++ mvn-clean-verify +++" | |
# Maven Properties | |
MVN_PROPERTIES="-DskipUTs -DfailIfNoTests=false -Dmaven.test.failure.ignore=false" | |
# if: github.event_name == 'release' add -DskipEnforceSnapshots | |
if [[ -n "${{ github.event.release.tag_name }}" ]]; then | |
MVN_PROPERTIES="$MVN_PROPERTIES -DskipEnforceSnapshots" | |
fi | |
echo "MVN_PROPERTIES=${MVN_PROPERTIES}" | |
# mvn clean verify | |
mvn -B -ntp clean verify $MVN_PROPERTIES | |
echo "::endgroup::" | |
# mvn-failsafe-report | |
- name: mvn-failsafe-report | |
id: mvn-failsafe-report | |
if: ${{ always() && !cancelled() && steps.mvn-clean-verify.conclusion != 'skipped' }} | |
working-directory: code | |
run: | | |
# mvn-failsafe-report | |
echo "::group::+++ mvn-failsafe-report +++" | |
# mvn surefire-report:failsafe-report-only | |
mvn -B -ntp surefire-report:failsafe-report-only -DalwaysGenerateSurefireReport=true | |
echo "::endgroup::" | |
# failsafe-results-verification | |
- name: failsafe-results-verification | |
id: failsafe-results-verification | |
if: ${{ always() && !cancelled() && steps.mvn-clean-verify.conclusion != 'skipped' }} | |
uses: ./.github/actions/test-results-verification | |
with: | |
# type: The type of results. Supported types: 'surefire', 'failsafe', 'jacoco', 'karate' and 'pitest'. | |
type: failsafe | |
# results_folder: The folder of the results. For example: | |
# 'surefire/failsafe': code/target/reports | |
# 'jacoco': code/jacoco-report-aggregate/target/site/jacoco-aggregate or code/jacoco-report-aggregate/target/site/jacoco-aggregate-it | |
# 'pitest': code/target/pit-reports | |
# 'karate': e2e/karate/target/karate-reports | |
results_folder: ${{ fromJSON(steps.config.outputs.config).integration.report.folder }} | |
# threshold: the threshold to verify, For example: 'coverage %' for 'jacoco' and 'pitest', 'success rate %' for 'surefire', 'failsafe' and 'karate' | |
threshold: 100 | |
# failsafe-report-upload | |
- name: failsafe-report-upload | |
id: failsafe-report-upload | |
if: ${{ always() && !cancelled() && steps.mvn-clean-verify.conclusion != 'skipped' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.event.repository.name }}-integration-${{ github.run_number }}-failsafe-report | |
path: ${{ fromJSON(steps.config.outputs.config).integration.report.folder }} | |
# jacoco-results-verification | |
- name: jacoco-results-verification | |
id: jacoco-results-verification | |
if: ${{ always() && !cancelled() && steps.mvn-clean-verify.conclusion != 'skipped' }} | |
uses: ./.github/actions/test-results-verification | |
with: | |
# type: The type of results. Supported types: 'surefire', 'failsafe', 'jacoco', 'karate' and 'pitest'. | |
type: jacoco | |
# results_folder: The folder of the results. For example: | |
# 'surefire/failsafe': code/target/reports | |
# 'jacoco': code/jacoco-report-aggregate/target/site/jacoco-aggregate or code/jacoco-report-aggregate/target/site/jacoco-aggregate-it | |
# 'pitest': code/target/pit-reports | |
# 'karate': e2e/karate/target/karate-reports | |
results_folder: ${{ fromJSON(steps.config.outputs.config).integration.jacoco.report.folder }} | |
# threshold: the threshold to verify, For example: 'coverage %' for 'jacoco' and 'pitest', 'success rate %' for 'surefire', 'failsafe' and 'karate' | |
threshold: ${{ fromJSON(steps.config.outputs.config).integration.coverage.threshold || 80 }} | |
# jacoco-report-upload | |
- name: jacoco-report-upload | |
id: jacoco-report-upload | |
if: ${{ always() && !cancelled() && steps.mvn-clean-verify.conclusion != 'skipped' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.event.repository.name }}-integration-${{ github.run_number }}-jacoco-report | |
path: ${{ fromJSON(steps.config.outputs.config).integration.jacoco.report.folder }} | |
# execution-logs-upload | |
- name: execution-logs-upload | |
id: execution-logs-upload | |
if: ${{ always() && !cancelled() && steps.mvn-clean-verify.conclusion != 'skipped' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.event.repository.name }}-karate-${{ github.run_number }}-logs | |
path: | | |
code/**/*.log |