Add .clangd file (#92) #383
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
push: | |
branches: | |
- develop | |
- feature/* | |
paths: | |
- "!cmake-init/templates/common/.github/**" | |
- "!cmake-init/templates/common/docs/**" | |
- "!cmake-init/templates/common/*.md" | |
- "!cmake-init/templates/common/.gitignore" | |
- "!cmake-init/templates/common/CMakeUserPresets.json" | |
- .github/workflows/* | |
- cmake-init/** | |
pull_request: | |
branches: | |
- develop | |
paths: | |
- "!cmake-init/templates/common/.github/**" | |
- "!cmake-init/templates/common/docs/**" | |
- "!cmake-init/templates/common/*.md" | |
- "!cmake-init/templates/common/.gitignore" | |
- "!cmake-init/templates/common/CMakeUserPresets.json" | |
- .github/workflows/* | |
- cmake-init/** | |
jobs: | |
test: | |
if: github.event.commits[0].message != 'Bump version' | |
strategy: | |
fail-fast: false | |
matrix: | |
job: [1, 2, 3, 4, 5, 6, 7, 8] | |
pm: [none, conan, vcpkg] | |
os: [macos-12, ubuntu-22.04, windows-2022] | |
include: | |
- { job: 1, type: "-s --examples", name: "Library (C++): shared", flag: "-D BUILD_SHARED_LIBS=YES" } | |
- { job: 2, type: "-s --examples", name: "Library (C++): static", flag: "" } | |
- { job: 3, type: "-h --examples", name: "Library (C++): header-only", flag: "" } | |
- { job: 4, type: -e, name: "Executable (C++)", flag: "" } | |
- { job: 5, type: "--c -s --examples", name: "Library (C): shared", flag: "-D BUILD_SHARED_LIBS=YES" } | |
- { job: 6, type: "--c -s --examples", name: "Library (C): static", flag: "" } | |
- { job: 7, type: "--c -h --examples", name: "Library (C): header-only", flag: "" } | |
- { job: 8, type: "--c -e", name: "Executable (C)", flag: "" } | |
name: "${{ matrix.name }} (${{ matrix.os }}) (PM: ${{ matrix.pm }})" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install static analyzers | |
if: matrix.os == 'ubuntu-22.04' | |
run: >- | |
sudo apt-get install clang-tidy-14 cppcheck -y -q | |
sudo update-alternatives --install | |
/usr/bin/clang-tidy clang-tidy | |
/usr/bin/clang-tidy-14 140 | |
- uses: actions/setup-python@v4 | |
with: { python-version: "3.8" } | |
- name: Create project | |
run: | | |
python -m zipapp cmake-init -p "/usr/bin/env python3" | |
python cmake-init.pyz ${{ matrix.type }} -p ${{ matrix.pm }} proj | |
- name: Test --vcpkg mode | |
working-directory: proj | |
run: | | |
python ../cmake-init.pyz --vcpkg shared -s | |
python ../cmake-init.pyz --vcpkg headeronly -h | |
- name: Lint generated project | |
if: matrix.os == 'ubuntu-22.04' | |
working-directory: proj | |
run: cmake -D FORMAT_COMMAND=clang-format-14 -P cmake/lint.cmake | |
- name: Setup MultiToolTask | |
if: matrix.os == 'windows-2022' | |
run: | | |
Add-Content "$env:GITHUB_ENV" 'UseMultiToolTask=true' | |
Add-Content "$env:GITHUB_ENV" 'EnforceProcessCountAcrossBuilds=true' | |
- name: Install Conan | |
if: matrix.pm == 'conan' | |
working-directory: proj | |
shell: bash | |
run: | | |
pip3 install conan | |
bash < .github/scripts/conan-profile.sh | |
conan install . -b missing | |
- name: Install vcpkg | |
if: matrix.pm == 'vcpkg' | |
uses: friendlyanon/setup-vcpkg@v1 | |
with: | |
committish: "9055f88ba53a99f51e3c733fe9c79703dc23d57d" | |
cache-version: "1" | |
ignore-reserve-cache-error: true | |
- name: Configure | |
shell: pwsh | |
run: cmake -S proj "--preset=ci-$("${{ matrix.os }}".split("-")[0])" | |
${{ matrix.flag }} | |
- name: Setup PATH | |
if: matrix.os == 'windows-2022' | |
run: Add-Content "$env:GITHUB_PATH" "$(Get-Location)\proj\build\Release" | |
- name: Build | |
run: cmake --build proj/build --config Release | |
- name: Install | |
run: cmake --install proj/build --config Release --prefix proj/prefix | |
- name: Test | |
run: ctest --test-dir proj/build -C Release --no-tests=error |