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
5 changes: 5 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none

CheckOptions:
- key: readability-identifier-length.IgnoredVariableNames
value: 'x|y|z'
- key: readability-identifier-length.IgnoredParameterNames
value: 'x|y|z'



Expand Down
16 changes: 5 additions & 11 deletions .github/actions/setup_cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
generator:
required: true
type: string
developer_mode:
packaging_maintainer_mode:
required: true
type: string

Expand All @@ -20,19 +20,13 @@ runs:
using: "composite"
steps:
- name: Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
# You might want to add .ccache to your cache configuration?
path: |
~/vcpkg
./build/vcpkg_installed
${{ env.CONAN_USER_HOME }}
~/.cache/pip
${{ env.HOME }}/.cache/vcpkg/archives
${{ env.XDG_CACHE_HOME }}/vcpkg/archives
${{ env.LOCALAPPDATA }}\vcpkg\archives
${{ env.APPDATA }}\vcpkg\archives
key: ${{ runner.os }}-${{ inputs.compiler }}-${{ inputs.build_type }}-${{ hashFiles('./conanfile.txt')}}-${{ inputs.generator }}-${{ inputs.developer_mode }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./vcpkg.json')}}
~/.ccache
key: ${{ runner.os }}-${{ inputs.compiler }}-${{ inputs.build_type }}-${{ inputs.generator }}-${{ inputs.packaging_maintainer_mode }}-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-${{ inputs.compiler }}-${{ inputs.build_type }}-${{ hashFiles('./conanfile.txt') }}
${{ runner.os }}-${{ inputs.compiler }}-${{ inputs.build_type }}

1 change: 1 addition & 0 deletions .github/constants.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJECT_NAME=myproject
2 changes: 1 addition & 1 deletion .github/template/template_name
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ftxui_template
cmake_template
2 changes: 1 addition & 1 deletion .github/template/template_repository
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cpp-best-practices/ftxui_template
cpp-best-practices/cmake_template
2 changes: 1 addition & 1 deletion .github/workflows/auto-clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: DoozyX/clang-format-lint-action@v0.13
with:
source: '.'
Expand Down
66 changes: 41 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ on:
- develop

env:
# Conan cache environment variables
CONAN_SYSREQUIRES_MODE: enabled
CONAN_USER_HOME: "${{ github.workspace }}/conan-cache"
CONAN_USER_HOME_SHORT: "${{ github.workspace }}/conan-cache/short"
CLANG_TIDY_VERSION: "13.0.0"
CLANG_TIDY_VERSION: "15.0.2"
VERBOSE: 1


jobs:
Test:
Expand All @@ -35,17 +33,19 @@ jobs:
- macos-10.15
- windows-2019
compiler:
# you can specify the version after `-` like "llvm-13.0.0".
- llvm-13.0.0
# you can specify the version after `-` like "llvm-15.0.2".
- llvm-15.0.2
- gcc-11
generator:
- "Ninja Multi-Config"
build_type:
- Release
- Debug
developer_mode:
packaging_maintainer_mode:
- ON
- OFF
build_shared:
- OFF

exclude:
# mingw is determined by this author to be too buggy to support
Expand All @@ -57,12 +57,18 @@ jobs:
# if you try to use a compiler that does not have gcov set
- compiler: gcc-11
gcov_executable: gcov
- compiler: llvm-13.0.0
enable_ipo: On

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

- os: macos-10.15
enable_ipo: Off

# Set up preferred package generators, for given build configurations
- build_type: Release
developer_mode: OFF
packaging_maintainer_mode: OFF
package_generator: TBZ2

# This exists solely to make sure a non-multiconfig build works
Expand All @@ -71,34 +77,45 @@ jobs:
generator: "Unix Makefiles"
build_type: Debug
gcov_executable: gcov
developer_mode: On
packaging_maintainer_mode: On
enable_ipo: Off

# Windows msvc builds
- os: windows-2022
compiler: msvc
generator: "Visual Studio 17 2022"
build_type: Debug
developer_mode: On
packaging_maintainer_mode: On
enable_ipo: On

- os: windows-2022
compiler: msvc
generator: "Visual Studio 17 2022"
build_type: Release
developer_mode: On
packaging_maintainer_mode: On
enable_ipo: On

- os: windows-2022
compiler: msvc
generator: "Visual Studio 17 2022"
build_type: Debug
developer_mode: Off
packaging_maintainer_mode: Off

- os: windows-2022
compiler: msvc
generator: "Visual Studio 17 2022"
build_type: Release
developer_mode: Off
packaging_maintainer_mode: Off
package_generator: ZIP

- os: windows-2022
compiler: msvc
generator: "Visual Studio 17 2022"
build_type: Release
packaging_maintainer_mode: On
enable_ipo: On
build_shared: On


steps:
- name: Check for llvm version mismatches
Expand All @@ -108,16 +125,22 @@ jobs:
script: |
core.setFailed('There is a mismatch between configured llvm compiler and clang-tidy version chosen')

- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Cache
uses: ./.github/actions/setup_cache
with:
compiler: ${{ matrix.compiler }}
build_type: ${{ matrix.build_type }}
developer_mode: ${{ matrix.developer_mode }}
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:
Expand All @@ -126,7 +149,6 @@ jobs:

cmake: true
ninja: true
conan: true
vcpkg: false
ccache: true
clangtidy: ${{ env.CLANG_TIDY_VERSION }}
Expand All @@ -137,15 +159,9 @@ jobs:
gcovr: true
opencppcoverage: true

- name: Cleanup Conan system packages (they are not properly cached)
run: |
conan remove -f '*/system'

# 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}} -DENABLE_DEVELOPER_MODE:BOOL=${{matrix.developer_mode}} -DOPT_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }} -DGIT_SHA:STRING=${{ github.sha }}
cmake -S . -B ./build -G "${{matrix.generator}}" -D${{ env.PROJECT_NAME }}_ENABLE_IPO=${{matrix.enable_ipo }} -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' }} -DGIT_SHA:STRING=${{ github.sha }}

- name: Build
# Execute the build. You can specify a specific target with "--target <NAME>"
Expand Down
30 changes: 12 additions & 18 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ on:
schedule:
- cron: '38 0 * * 5'

env:
# Conan cache environment variables
CONAN_SYSREQUIRES_MODE: enabled
CONAN_USER_HOME: "${{ github.workspace }}/conan-cache"
CONAN_USER_HOME_SHORT: "${{ github.workspace }}/conan-cache/short"


jobs:
analyze:
Expand All @@ -49,21 +43,26 @@ jobs:
- "Ninja Multi-Config"
build_type:
- Debug
developer_mode:
- OFF
packaging_maintainer_mode:
- ON


steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Cache
uses: ./.github/actions/setup_cache
with:
compiler: ${{ matrix.compiler }}
build_type: ${{ matrix.build_type }}
developer_mode: ${{ matrix.developer_mode }}
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
Expand All @@ -73,7 +72,6 @@ jobs:

cmake: true
ninja: true
conan: true
vcpkg: false
ccache: true
clangtidy: false
Expand All @@ -83,19 +81,15 @@ jobs:
gcovr: false
opencppcoverage: false

- name: Cleanup Conan system packages (they are not properly cached)
run: |
conan remove -f '*/system'

# 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}} -DENABLE_DEVELOPER_MODE:BOOL=${{matrix.developer_mode}} -DOPT_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }}
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@v1
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.
Expand All @@ -110,4 +104,4 @@ jobs:
cmake --build ./build --config ${{matrix.build_type}}

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