Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@
set(CMAKE_C_COMPILER clang CACHE FILEPATH "C compiler")
set(CMAKE_CXX_COMPILER clang++ CACHE FILEPATH "C++ compiler")
set(CMAKE_ASM_COMPILER clang CACHE FILEPATH "assembler")
set(CMAKE_CXX_STANDARD ${CETLVAST_CPP_STANDARD})
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_C_COVERAGE_PROCESSOR "llvm-cov gcov")
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@
set(CMAKE_C_COMPILER gcc CACHE FILEPATH "C compiler")
set(CMAKE_CXX_COMPILER g++ CACHE FILEPATH "C++ compiler")
set(CMAKE_ASM_COMPILER gcc CACHE FILEPATH "assembler")
set(CMAKE_CXX_STANDARD ${CETLVAST_CPP_STANDARD})
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_COVERAGE_PROCESSOR gcov)
13 changes: 7 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"twxs.cmake",
"ms-vscode.cmake-tools",
"ban.spellright",
"xaver.clang-format"
"ms-vscode.cpptools-extension-pack",
"streetsidesoftware.code-spell-checker",
"xaver.clang-format",
"vadimcn.vscode-lldb",
"matepek.vscode-catch2-test-adapter",
"ms-vscode.hexeditor"
]
}
},
"workspaceFolder": "/repo",
"workspaceMount": "source=${localWorkspaceFolder},target=/repo,type=bind,consistency=delegated",
"mounts": [
"source=profile,target=/root,type=volume",
"source=profile-cetl,target=/root,type=volume",
"target=/root/.vscode-server,type=volume"
]
}
108 changes: 59 additions & 49 deletions .github/workflows/cetlvast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,75 +15,92 @@ jobs:
container: ghcr.io/opencyphal/toolshed:ts22.4.3
strategy:
matrix:
std: [base, intermediate, target]
build_flavor: [Debug, Release]
exceptions: [exceptions, no-exceptions]
std: [14, 17, 20]
toolchain: [gcc, clang]
suite: [unittest, compile]
include:
- build_flavor: Coverage
exceptions: no-exceptions
std: 14
toolchain: gcc
exclude:
- build_flavor: Debug
exceptions: no-exceptions
std: 14
toolchain: gcc
steps:
- uses: actions/checkout@v3
- name: setup environment common
run: >
echo "CETLVAST_EXT_PATH=$(./cetlvast/verify.py -cd ./cetlvast -ls extdir none)" >> $GITHUB_ENV;
echo "CETLVAST_SUITE_UNITTEST_PATH=$(./cetlvast/verify.py -cd ./cetlvast -ls builddir unittest)" >> $GITHUB_ENV;
echo "CETLVAST_SUITE_BUILD_PATH=$(./cetlvast/verify.py -cd ./cetlvast -ls builddir none)" >> $GITHUB_ENV;
echo "CETLVAST_COVERAGE_REPORT_FORMAT=sonarqube" >> $GITHUB_ENV

- name: Cache ext modules
id: cetlvast-ext
uses: actions/cache@v3
env:
cache-name: cetlvast-ext-cache
with:
path: ${{ env.CETLVAST_EXT_PATH }}
path: cetlvast/build_external
key: gtest_b796f7d44681514f58a683a3a71ff17c94edb0c1
- name: run tests
run: >
./cetlvast/verify.py -cd ./cetlvast
--force-ninja
--coverage ${{ env.CETLVAST_COVERAGE_REPORT_FORMAT }}
--build-flavor Debug
./build-tools/bin/verify.py
-v
--online
--asserts
--generate-test-report testExecutions.xml
--${{ matrix.exceptions }}
--build-flavor ${{ matrix.build_flavor }}
--cpp-standard ${{ matrix.std }}
--toolchain ${{ matrix.toolchain }}
${{ matrix.suite }}
test
- name: debug output
if: ${{ runner.debug == '1' }}
run: ls -lAhR build/
- name: upload-artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.suite }}-${{ matrix.std }}-${{ matrix.toolchain }}
name: ${{ matrix.build_flavor }}-${{ matrix.exceptions }}-${{ matrix.std }}-${{ matrix.toolchain }}
path: |
${{ env.CETLVAST_SUITE_BUILD_PATH }}/compile_commands.json
${{ env.CETLVAST_SUITE_BUILD_PATH }}/cetlvast/suites/${{ matrix.suite }}
build/compile_commands.json
build/*/**/coverage.xml
build/*/**/*-sonarqube.xml
build/*/**/gcovr_html/*.*
if-no-files-found: error
docs:
runs-on: ubuntu-latest
container: ghcr.io/opencyphal/toolshed:ts22.4.3
steps:
- uses: actions/checkout@v3
- name: setup environment
run: >
echo "CETLVAST_SUITE_DOCS_PATH=$(./cetlvast/verify.py -cd ./cetlvast -ls builddir docs)" >> $GITHUB_ENV;
echo "CETLVAST_EXT_PATH=$(./cetlvast/verify.py -cd ./cetlvast -ls extdir none)" >> $GITHUB_ENV
- name: Cache ext modules
id: cetlvast-ext
uses: actions/cache@v3
env:
cache-name: cetlvast-ext-cache
with:
path: ${{ env.CETLVAST_EXT_PATH }}
path: cetlvast/build_external
key: gtest_b796f7d44681514f58a683a3a71ff17c94edb0c1
- name: Check Style
run: |
./cetlvast/verify.py -cd ./cetlvast lint
- name: verify
run: ./cetlvast/verify.py -cd ./cetlvast docs
- name: doc-gen
run: >
./build-tools/bin/verify.py
-v
--online
--asserts
--build-flavor Debug
--cpp-standard 14
build-docs
- name: Setup Pages
if: ${{ github.event_name != 'pull_request' }}
uses: actions/configure-pages@v3
- name: Upload docs
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-pages-artifact@v1
with:
path: "${{ env.CETLVAST_SUITE_DOCS_PATH }}/html/"

path: "build/suites/docs/html/"
- name: upload-pr-docs
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: pr-docs
path: "build/suites/docs/html/"
if-no-files-found: error
sonarqube:
needs:
- verification
Expand All @@ -96,28 +113,19 @@ jobs:
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@v1
- name: setup environment
run: >
echo "CETLVAST_EXT_PATH=$(./cetlvast/verify.py -cd ./cetlvast -ls extdir none)" >> $GITHUB_ENV;
echo "CETLVAST_SUITE_BUILD_PATH=$(./cetlvast/verify.py -cd ./cetlvast -ls builddir none)" >> $GITHUB_ENV;
echo "CETLVAST_COVERAGE_REPORT=$(./cetlvast/verify.py -cd ./cetlvast -ls covri --coverage sonarqube unittest)" >> $GITHUB_ENV;
echo "CETLVAST_TEST_REPORT=$(./cetlvast/verify.py -cd ./cetlvast -ls tests -gtr testExecutions.xml unittest)" >> $GITHUB_ENV;
echo "CETLVAST_CPP_BASE=c++$(./cetlvast/verify.py -cd ./cetlvast -ls cppstd --cpp-standard base docs)" >> $GITHUB_ENV

- name: Cache ext modules
id: cetlvast-ext
uses: actions/cache@v3
env:
cache-name: cetlvast-ext-cache
with:
path: ${{ env.CETLVAST_EXT_PATH }}
path: cetlvast/build_external
key: gtest_b796f7d44681514f58a683a3a71ff17c94edb0c1

- uses: actions/download-artifact@v3
with:
name: unittest-base-clang
path: ${{ env.CETLVAST_SUITE_BUILD_PATH }}

name: Coverage-no-exceptions-14-gcc
path: build
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -128,16 +136,18 @@ jobs:
--define sonar.projectKey=OpenCyphal_CETL
--define sonar.projectName=CETLVaSt
--define sonar.projectVersion=1.0
--define sonar.sources=include,cetlvast/suites/unittest
--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/**/*"
--define sonar.cpd.exclusions="cetlvast/suites/unittest/**/*"
--define sonar.cfamily.compile-commands=${{ env.CETLVAST_SUITE_BUILD_PATH }}/compile_commands.json
--define sonar.cfamily.reportingCppStandardOverride=${{ env.CETLVAST_CPP_BASE }}
--define sonar.coverageReportPaths=${{ env.CETLVAST_COVERAGE_REPORT }}
--define sonar.testExecutionReportPaths=${{ env.CETLVAST_TEST_REPORT }}
--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="build/compile_commands.json"
--define sonar.cfamily.reportingCppStandardOverride=c++14
--define sonar.coverageReportPaths="build/suites/unittest/coverage.xml,build/suites/docs/examples/coverage.xml"
--define sonar.testExecutionReportPaths="build/suites/unittest/unittest-sonarqube.xml,build/suites/docs/examples/examples-sonarqube.xml"

deploy-docs:
if: ${{ (github.event_name == 'release' && !github.event.release.prerelease) || github.event_name == 'workflow_dispatch' }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ jobs:
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

- run: |
echo "Building unittests for analysis"
./cetlvast/verify.py -cd ./cetlvast -bf Debug unittest
./build-tools/bin/verify.py -v --dont-force-ninja --online clean-build-build_examples

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ __pycache__
.mypy*
.pyenv
.dockerup
.scannerwork

# Eclipse
.metadata
Expand Down
57 changes: 6 additions & 51 deletions .vscode/cmake-kits.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,18 @@
[
{
"name": "unittest-gcc",
"name": "toolshed-gcc",
"description": "Compile and run unit tests using the host's default gcc toolchain.",
"toolchainFile": "${workspaceFolder}/cetlvast/cmake/toolchains/gcc-native.cmake",
"toolchainFile": "${workspaceFolder}/.devcontainer/cmake/toolchains/gcc-native.cmake",
"cmakeSettings": {
"CETLVAST_FLAG_SET": "${workspaceFolder}/cetlvast/cmake/compiler_flag_sets/native.cmake",
"CETLVAST_TEST_SUITE": "${workspaceFolder}/cetlvast/cmake/suites/unittest.cmake"
"CETLVAST_FLAG_SET": "${workspaceFolder}/cetlvast/cmake/compiler_flag_sets/default.cmake"
}
},
{
"name": "unittest-clang",
"name": "toolshed-clang",
"description": "Compile and run unit tests using the host's default clang toolchain.",
"toolchainFile": "${workspaceFolder}/cetlvast/cmake/toolchains/clang-native.cmake",
"toolchainFile": "${workspaceFolder}/.devcontainer/cmake/toolchains/clang-native.cmake",
"cmakeSettings": {
"CETLVAST_FLAG_SET": "${workspaceFolder}/cetlvast/cmake/compiler_flag_sets/native.cmake",
"CETLVAST_TEST_SUITE": "${workspaceFolder}/cetlvast/cmake/suites/unittest.cmake"
}
},
{
"name": "compile-gcc",
"description": "Compile and run compilation tests using the host's default gcc toolchain.",
"toolchainFile": "${workspaceFolder}/cetlvast/cmake/toolchains/gcc-native.cmake",
"cmakeSettings": {
"CETLVAST_FLAG_SET": "${workspaceFolder}/cetlvast/cmake/compiler_flag_sets/native.cmake",
"CETLVAST_TEST_SUITE": "${workspaceFolder}/cetlvast/cmake/suites/compile.cmake"
}
},
{
"name": "compile-clang",
"description": "Compile and run compilation tests using the host's default clang toolchain.",
"toolchainFile": "${workspaceFolder}/cetlvast/cmake/toolchains/clang-native.cmake",
"cmakeSettings": {
"CETLVAST_FLAG_SET": "${workspaceFolder}/cetlvast/cmake/compiler_flag_sets/native.cmake",
"CETLVAST_TEST_SUITE": "${workspaceFolder}/cetlvast/cmake/suites/compile.cmake"
}
},
{
"name": "docs-gcc",
"description": "Build the documentation and examples programs.",
"toolchainFile": "${workspaceFolder}/cetlvast/cmake/toolchains/gcc-native.cmake",
"cmakeSettings": {
"CETLVAST_FLAG_SET": "${workspaceFolder}/cetlvast/cmake/compiler_flag_sets/native.cmake",
"CETLVAST_TEST_SUITE": "${workspaceFolder}/cetlvast/cmake/suites/docs.cmake"
}
},
{
"name": "docs-clang",
"description": "Build the documentation and examples programs.",
"toolchainFile": "${workspaceFolder}/cetlvast/cmake/toolchains/clang-native.cmake",
"cmakeSettings": {
"CETLVAST_FLAG_SET": "${workspaceFolder}/cetlvast/cmake/compiler_flag_sets/native.cmake",
"CETLVAST_TEST_SUITE": "${workspaceFolder}/cetlvast/cmake/suites/docs.cmake"
}
},
{
"name": "lint",
"description": "Static checkers.",
"cmakeSettings": {
"CETLVAST_TEST_SUITE": "${workspaceFolder}/cetlvast/cmake/suites/lint.cmake"
"CETLVAST_FLAG_SET": "${workspaceFolder}/cetlvast/cmake/compiler_flag_sets/default.cmake"
}
}
]
Loading