Skip to content

Commit

Permalink
Update ci build scripts
Browse files Browse the repository at this point in the history
build on OS-latest with newest setup-cpp version

ymllint all files

fix typos and strip WS
  • Loading branch information
ClausKlein committed Sep 6, 2023
1 parent d19d892 commit a77050e
Show file tree
Hide file tree
Showing 5 changed files with 271 additions and 96 deletions.
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"
}
]
}
]
}
23 changes: 12 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ on:

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


jobs:
Test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
fail-fast: true

# Recommendations:
# * support at least 2 operating systems
Expand All @@ -29,13 +30,13 @@ 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
- gcc-11
- gcc
generator:
- "Ninja Multi-Config"
build_type:
Expand All @@ -49,21 +50,21 @@ jobs:

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

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
- compiler: gcc
gcov_executable: gcov
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,8 +73,8 @@ jobs:
package_generator: TBZ2

# This exists solely to make sure a non-multiconfig build works
- os: ubuntu-20.04
compiler: gcc-11
- os: ubuntu-latest
compiler: gcc
generator: "Unix Makefiles"
build_type: Debug
gcov_executable: gcov
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

0 comments on commit a77050e

Please sign in to comment.