Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ci build scripts #69

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
167 changes: 167 additions & 0 deletions .CMakeUserPresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 26,
"patch": 0
},
"configurePresets": [
{
"name": "default-config",
"hidden": true,
"generator": "Ninja",
"cacheVariables": {
"CMAKE_HOST_SYSTEM_PROCESSOR": "$penv{PROCESSOR_ARCHITECTURE}"
}
},
{
"name": "common-config",
"description": "Settings for all toolchains",
"hidden": true,
"inherits": "default-config",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"ENABLE_DOXYGEN": false,
"ENABLE_CPPCHECK": false,
"ENABLE_CLANG_TIDY": false
},
"vendor": {
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"
}
}
},
{
"name": "debug",
"displayName": "Debug",
"description": "Debug build type",
"inherits": "conf-unixlike-common",
"cacheVariables": {
"CMAKE_SKIP_INSTALL_RULES": true,
"CMAKE_BUILD_TYPE": "Debug",
"myproject_ENABLE_COVERAGE": true
}
},
{
"name": "release",
"displayName": "Release",
"description": "Release build type",
"inherits": "conf-unixlike-common",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"ENABLE_DOXYGEN": true
}
}
],
"testPresets": [
{
"name": "common-test",
"description":
"Test CMake settings that apply to all configurations",
"hidden": true,
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": true
}
},
{
"name": "debug",
"displayName": "Strict",
"description": "Enable output and stop on failure",
"inherits": "common-test",
"configuration": "Debug",
"configurePreset": "debug"
},
{
"name": "release",
"displayName": "Strict",
"description": "Enable output and stop on failure",
"inherits": "common-test",
"configuration": "Release",
"configurePreset": "release"
}
],
"buildPresets": [
{
"name": "release",
"configurePreset": "release"
},
{
"name": "install",
"configurePreset": "release",
"targets": [
"install"
]
},
{
"name": "doxygen-docs",
"configurePreset": "release",
"targets": [
"doxygen-docs"
]
},
{
"name": "debug",
"configurePreset": "debug"
}
],
"packagePresets": [
{
"name": "release",
"configurePreset": "release",
"generators": [
"TGZ"
]
}
],
"workflowPresets": [
{
"description": "Developer workflow without installation",
"name": "debug",
"steps": [
{
"type": "configure",
"name": "debug"
},
{
"type": "build",
"name": "debug"
},
{
"type": "test",
"name": "debug"
}
]
},
{
"description": "Release workflow without test",
"name": "release",
"steps": [
{
"name": "release",
"type": "configure"
},
{
"name": "release",
"type": "build"
},
{
"name": "release",
"type": "test"
},
{
"name": "install",
"type": "build"
},
{
"name": "release",
"type": "package"
}
]
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/auto-clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
extensions: 'h,cpp,hpp'
clangFormatVersion: 12
inplace: True
- uses: EndBug/add-and-commit@v4
- uses: EndBug/add-and-commit@v9
with:
author_name: Clang Robot
author_email: robot@example.com
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

env:
CLANG_TIDY_VERSION: "15.0.2"
CPM_SOURCE_CACHE: ~/.cache/CPM
VERBOSE: 1


Expand All @@ -29,9 +30,9 @@ jobs:
# and your own projects needs
matrix:
os:
- ubuntu-20.04
- macos-10.15
- windows-2019
- ubuntu-latest
- macos-latest
- windows-2022
compiler:
# you can specify the version after `-` like "llvm-15.0.2".
- llvm-15.0.2
Expand All @@ -49,21 +50,21 @@ jobs:

exclude:
# mingw is determined by this author to be too buggy to support
- os: windows-2019
- os: windows-2022
compiler: gcc-11

include:
# Add appropriate variables for gcov version required. This will intentionally break
# if you try to use a compiler that does not have gcov set
- compiler: gcc-11
gcov_executable: gcov
gcov_executable: gcov-11
enable_ipo: On

- compiler: llvm-15.0.2
enable_ipo: Off
gcov_executable: "llvm-cov gcov"

- os: macos-10.15
- os: macos-latest
enable_ipo: Off

# Set up preferred package generators, for given build configurations
Expand All @@ -72,11 +73,11 @@ jobs:
package_generator: TBZ2

# This exists solely to make sure a non-multiconfig build works
- os: ubuntu-20.04
- os: ubuntu-latest
compiler: gcc-11
generator: "Unix Makefiles"
build_type: Debug
gcov_executable: gcov
gcov_executable: gcov-11
packaging_maintainer_mode: On
enable_ipo: Off

Expand Down
114 changes: 57 additions & 57 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,60 +48,60 @@ jobs:


steps:
- uses: actions/checkout@v3

- name: Setup Cache
uses: ./.github/actions/setup_cache
with:
compiler: ${{ matrix.compiler }}
build_type: ${{ matrix.build_type }}
packaging_maintainer_mode: ${{ matrix.packaging_maintainer_mode }}
generator: ${{ matrix.generator }}

- name: Project Name
uses: cardinalby/export-env-action@v2
with:
envFile: '.github/constants.env'


- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}

cmake: true
ninja: true
vcpkg: false
ccache: true
clangtidy: false

cppcheck: false

gcovr: false
opencppcoverage: false

# make sure coverage is only enabled for Debug builds, since it sets -O0 to make sure coverage
# has meaningful results
- name: Configure CMake
run: |
cmake -S . -B ./build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -D${{ env.PROJECT_NAME }}_PACKAGING_MAINTAINER_MODE:BOOL=${{matrix.packaging_maintainer_mode}} -D${{ env.PROJECT_NAME }}_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main


- name: Build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cmake --build ./build --config ${{matrix.build_type}}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- uses: actions/checkout@v3

- name: Setup Cache
uses: ./.github/actions/setup_cache
with:
compiler: ${{ matrix.compiler }}
build_type: ${{ matrix.build_type }}
packaging_maintainer_mode: ${{ matrix.packaging_maintainer_mode }}
generator: ${{ matrix.generator }}

- name: Project Name
uses: cardinalby/export-env-action@v2
with:
envFile: '.github/constants.env'


- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}

cmake: true
ninja: true
vcpkg: false
ccache: true
clangtidy: false

cppcheck: false

gcovr: false
opencppcoverage: false

# make sure coverage is only enabled for Debug builds, since it sets -O0 to make sure coverage
# has meaningful results
- name: Configure CMake
run: |
cmake -S . -B ./build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -D${{ env.PROJECT_NAME }}_PACKAGING_MAINTAINER_MODE:BOOL=${{matrix.packaging_maintainer_mode}} -D${{ env.PROJECT_NAME }}_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main


- name: Build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cmake --build ./build --config ${{matrix.build_type}}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Loading
Loading