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 MIT License | ||
# | ||
# Copyright 2024 Vector Informatik, GmbH. | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
# | ||
name: GitHub Action for VectorCAST | ||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
env: | ||
# Relative path from checkout to the VectorCAST Project | ||
VC_Manage_Project="Project" | ||
# Use "--jobs=##" to use parallel number of jobs per compiler node; otherwise, for serial build/execute set to "" or "--jobs=1" | ||
VC_Job_Count="--jobs=4" | ||
# Use "--incremental" to use VecteorCAST Change Based Testing; otherwise, set to "" | ||
VC_useCBT="--incremental" | ||
# Use CI licenses for VectorCAST Continuous Integration (headless) licenses | ||
# set to 1 to use CI licenses and 0 to not user CI License | ||
VCAST_USE_CI_LICENSES=0 | ||
# maybe left over from gitlab integration | ||
CI_PROJECT_DIR: ${{ github.workspace }} | ||
jobs: | ||
build: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# Use for only generating Junit and Cobertura metrics | ||
- name: VectorCAST Generate Metrics | ||
run: ${VECTORCAST_DIR}/vpython vc_scripts/vcast_actions.py ${VC_Manage_Project} --build-execute --junit --cobertura --exit_with_failed_count=10 ${VC_Job_Count} ${VC_useCBT} | ||
# Cobertura reporting | ||
- name: Publish Cobertura Report | ||
uses: 5monkeys/cobertura-action@master | ||
with: | ||
path: '**/xml_data/cobertura/coverage_results*.xml' | ||
minimum_coverage: 0 | ||
# Junit reporting | ||
- name: Publish Test Report | ||
uses: mikepenz/action-junit-report@v3 | ||
if: success() || failure() # always run even if the previous step fails | ||
with: | ||
report_paths: '**/xml_data/junit/test_results*.xml' | ||
detailed_summary: true | ||
fail_on_failure: true | ||
include_passed: true | ||