Skip to content

Adding cmake presets, switching to ninja-multi-config #648

Adding cmake presets, switching to ninja-multi-config

Adding cmake presets, switching to ninja-multi-config #648

Workflow file for this run

name: "CETLVaSt"
on:
push: # Further filtering is done in the jobs.
pull_request:
branches:
- main
- 'issue/*'
release:
types: [ published ]
workflow_dispatch:
jobs:
verification-x86:
if: >
contains(github.event.head_commit.message, '#verification') ||
contains(github.ref, '/main') ||
contains(github.ref, '/issue/') ||
(github.event_name == 'pull_request')
runs-on: ubuntu-latest
container: ghcr.io/opencyphal/toolshed:ts24.4.1
strategy:
matrix:
toolchain: [
"gcc-native-32",
"clang-native"
]
standard: [
"cpp-14",
"cpp-17",
"cpp-20"
]
steps:
- uses: actions/checkout@v4
- name: Cache ext modules
id: cetlvast-ext
uses: actions/cache@v4
env:
cache-name: cetlvast-ext-cache
with:
path: cetlvast/build_external
key: gtest_v1.16.0_benchmark_v1.9.1_o1heap_aa3c253923db36eee7d73a4a5e30884a5fe7a6eb
- name: run tests
working-directory: cetlvast
env:
GTEST_COLOR: yes
run: >
cmake --workflow --preset workflow-${{ matrix.toolchain }}-${{ matrix.standard }}-online
- name: debug output
if: ${{ runner.debug == '1' }}
run: ls -lAhR cetlvast/build/
- name: upload-artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.toolchain }}-${{ matrix.standard }}
path: |
cetlvast/build/compile_commands.json
cetlvast/build/*/**/coverage.xml
cetlvast/build/*/**/*-sonarqube.xml
cetlvast/build/*/**/gcovr_html/*.*
if-no-files-found: error
verification-arm64:
if: >
contains(github.event.head_commit.message, '#verification') ||
contains(github.ref, '/main') ||
contains(github.ref, '/issue/') ||
(github.event_name == 'pull_request')
runs-on: ubuntu-24.04-arm
container: ghcr.io/opencyphal/toolshed:ts24.4.1
strategy:
matrix:
toolchain: [
"gcc-native",
"clang-native"
]
standard: [
"cpp-14",
"cpp-17",
"cpp-20"
]
steps:
- uses: actions/checkout@v4
- name: Cache ext modules
id: cetlvast-ext
uses: actions/cache@v4
env:
cache-name: cetlvast-ext-cache
with:
path: cetlvast/build_external
key: gtest_v1.16.0_benchmark_v1.9.1_o1heap_aa3c253923db36eee7d73a4a5e30884a5fe7a6eb
- name: run tests
working-directory: cetlvast
env:
GTEST_COLOR: yes
run: >
cmake --workflow --preset workflow-${{ matrix.toolchain }}-${{ matrix.standard }}-online
- name: debug output
if: ${{ runner.debug == '1' }}
run: ls -lAhR cetlvast/build/
- name: upload-artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.toolchain }}-${{ matrix.standard }}
path: |
cetlvast/build/compile_commands.json
cetlvast/build/*/**/coverage.xml
cetlvast/build/*/**/*-sonarqube.xml
cetlvast/build/*/**/gcovr_html/*.*
if-no-files-found: error
docs:
if: >
contains(github.event.head_commit.message, '#docs') ||
contains(github.ref, '/main') ||
contains(github.ref, '/issue/') ||
(github.event_name == 'pull_request')
runs-on: ubuntu-latest
container: ghcr.io/opencyphal/toolshed:ts24.4.1
steps:
- uses: actions/checkout@v4
- name: Cache ext modules
id: cetlvast-ext
uses: actions/cache@v4
env:
cache-name: cetlvast-ext-cache
with:
path: cetlvast/build_external
key: gtest_v1.16.0_benchmark_v1.9.1_o1heap_aa3c253923db36eee7d73a4a5e30884a5fe7a6eb
- name: doc-gen-configure
working-directory: cetlvast
run: cmake --preset configure-gcc-native-cpp-14-online
- name: doc-gen-build
working-directory: cetlvast/build
run: ninja docs
- name: Setup Pages
if: ${{ github.event_name != 'pull_request' }}
uses: actions/configure-pages@v5
- name: Upload docs
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-pages-artifact@v3
with:
path: "cetlvast/build/suites/docs/html/"
- name: Deploy to GitHub Pages
if: ${{ github.event_name != 'pull_request' }}
id: deployment
uses: actions/[email protected]
- name: upload-pr-docs
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-pages-artifact@v3
with:
name: pr-docs
path: "cetlvast/build/suites/docs/html/"
sonarqube:
if: >
contains(github.event.head_commit.message, '#sonar') ||
contains(github.ref, '/main') ||
contains(github.ref, '/issue/') ||
(github.event_name == 'pull_request')
needs:
- verification

Check failure on line 162 in .github/workflows/cetlvast.yml

View workflow run for this annotation

GitHub Actions / CETLVaSt

Invalid workflow file

The workflow is not valid. .github/workflows/cetlvast.yml (Line: 162, Col: 7): Job 'sonarqube' depends on unknown job 'verification'. .github/workflows/cetlvast.yml (Line: 211, Col: 9): Job 'deploy-docs' depends on job 'sonarqube' which creates a cycle in the dependency graph.
- docs
runs-on: ubuntu-latest
container: ghcr.io/opencyphal/toolshed:ts24.4.1
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis by sonarqube.
- name: Install sonar-scanner
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Cache ext modules
id: cetlvast-ext
uses: actions/cache@v4
env:
cache-name: cetlvast-ext-cache
with:
path: cetlvast/build_external
key: gtest_v1.16.0_benchmark_v1.9.1_o1heap_aa3c253923db36eee7d73a4a5e30884a5fe7a6eb
- uses: actions/download-artifact@v3
with:
name: Coverage-exceptions-14-gcc
path: cetlvast/build
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >
sonar-scanner
--define sonar.organization=opencyphal
--define sonar.projectKey=OpenCyphal_CETL
--define sonar.projectName=CETLVaSt
--define sonar.projectVersion=1.0
--define sonar.sources=include,cetlvast/suites/unittest/sonar.cpp
--define sonar.tests=cetlvast/suites/unittest,cetlvast/suites/docs/examples
--define sonar.test.inclusions=test_*.cpp,example_*.cpp
--define sonar.sourceEncoding=UTF-8
--define sonar.host.url=https://sonarcloud.io
--define sonar.cfamily.ignoreHeaderComments=false
--define sonar.coverage.exclusions="cetlvast/suites/unittest/**/*,cetlvast/suites/docs/examples/**/*,**/sonar.cpp"
--define sonar.cpd.exclusions="cetlvast/suites/unittest/**/*,cetlvast/suites/docs/examples/**/*,**/sonar.cpp"
--define sonar.cfamily.compile-commands="cetlvast/build/compile_commands.json"
--define sonar.cfamily.reportingCppStandardOverride=c++14
--define sonar.coverageReportPaths="cetlvast/build/suites/unittest/coverage.xml,cetlvast/build/suites/docs/examples/coverage.xml"
--define sonar.testExecutionReportPaths="cetlvast/build/suites/unittest/unittest-sonarqube.xml,cetlvast/build/suites/docs/examples/examples-sonarqube.xml"
deploy-docs:
if: ${{ (github.event_name == 'release' && !github.event.release.prerelease) || github.event_name == 'workflow_dispatch' }}
needs:
- sonarqube
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: read
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1