Add test for CIC-6 #79
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
# This is a basic workflow to help you get started with the C/C++test Coverage for a CMake-based project. | |
name: Build and test | |
on: | |
# Triggers the workflow on push or pull request events but only for the master (main) branch. | |
push: | |
branches: [ master, main ] | |
pull_request: | |
branches: [ master, main ] | |
# Allows you to run this workflow manually from the Actions tab. | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel. | |
jobs: | |
build-test: | |
name: Build and test | |
# Specifies the type of runner that the job will run on. | |
runs-on: self-hosted | |
# Specifies required permissions for upload-sarif action | |
permissions: | |
security-events: write | |
actions: write | |
contents: write | |
pages: write | |
id-token: write | |
# Steps represent a sequence of tasks that will be executed as part of the job. | |
steps: | |
# Checks out your repository under $GITHUB_WORKSPACE, so that your job can access it. | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Configures your CMake project. Be sure the compile_commands.json file is created. | |
- name: Configure project | |
run: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCPPTEST_COVERAGE=ON -S . -B build | |
# Builds your CMake project. | |
- name: Build project | |
run: cmake --build build | |
# Tests your CMake project. | |
- name: Test project | |
run: cd build && rm -rf cpptest-coverage/*/*.clog && ctest || true && make cpptestcov-compute cpptestcov-suppress cpptestcov-report cpptestcov-publish | |
- name: Archive reports | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: CpptestReports | |
path: | | |
reports/*.* | |
.coverage/ | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: reports/html | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 | |
- name: Print Report URL | |
env: | |
REPORT_URL: ${{ steps.deployment.outputs.page_url }} | |
run: echo "Coverage report $REPORT_URL" |