Add action for codeql and test (#66)

* Add action for codeql and test

* Update LTTng.yml
This commit is contained in:
Kyle Sabo 2024-06-05 16:01:25 -07:00 коммит произвёл GitHub
Родитель 6fb2bb7e4a
Коммит 1eed827b3b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 151 добавлений и 0 удалений

48
.github/workflows/LTTng.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,48 @@
name: LTTng
on:
push:
branches: [ "main" ]
paths-ignore:
- 'etw/**'
pull_request:
branches: [ "main" ]
paths-ignore:
- 'etw/**'
schedule:
- cron: '17 17 2,16 * *'
permissions:
security-events: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
preset: ["Release", "Debug"]
defaults:
run:
working-directory: ./LTTng
steps:
- uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: cpp
- name: Install deps
run: sudo apt-get update && sudo apt-get install -y cmake liblttng-ust-dev
- name: Configure CMake
run: cmake --preset ${{matrix.preset}}
- name: build
run: cmake --build --preset ${{matrix.preset}}
- name: test
run: ctest --preset ${{matrix.preset}}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

101
LTTng/CMakePresets.json Normal file
Просмотреть файл

@ -0,0 +1,101 @@
{
"version": 3,
"configurePresets": [
{
"name": "Release",
"description": "Compile project with release build settings",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/build/out/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install/${presetName}"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": ["Linux"]
},
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
"copySources": true,
"rsyncCommandArgs": ["-t", "--delete", "--delete-excluded"],
"copySourcesOptions": {
"method": "rsync"
}
}
}
},
{
"name": "Debug",
"description": "Compile project with debug build settings",
"inherits": "Release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "ReleaseClang",
"displayName": "Release clang",
"inherits": "Release",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++"
}
},
{
"name": "DebugClang",
"inherits": "Debug",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++"
}
},
{
"name": "DebugGCC",
"inherits": "Debug",
"cacheVariables": {
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++"
}
},
{
"name": "ReleaseGCC",
"inherits": "Release",
"cacheVariables": {
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++"
}
}
],
"buildPresets": [
{
"name": "Release",
"description": "",
"displayName": "",
"configurePreset": "Release"
},
{
"name": "Debug",
"description": "",
"displayName": "",
"configurePreset": "Debug"
}
],
"testPresets": [
{
"name": "Release",
"description": "",
"displayName": "",
"configurePreset": "Release"
},
{
"name": "Debug",
"description": "",
"displayName": "",
"configurePreset": "Debug"
}
]
}

Просмотреть файл

@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.5)
include(GNUInstallDirs)
set(TLG_INCLUDEDIR ${PROJECT_SOURCE_DIR}/include/)
# Add source to this project's executable.