-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: vityaman <[email protected]>
- Loading branch information
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: CMake | ||
|
||
on: | ||
push: | ||
branches: [trunk] | ||
pull_request: | ||
branches: [trunk] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
cmake_build_type: [Asan, Release] | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: | | ||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | ||
sudo add-apt-repository "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main" | ||
sudo apt update | ||
sudo apt install build-essential | ||
sudo apt install clang-format-18 clang-tidy-18 | ||
sudo ln -s $(which clang-format-18) /usr/local/bin/clang-format | ||
sudo ln -s $(which clang-tidy-18) /usr/local/bin/clang-tidy | ||
- name: Setup ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
create-symlink: true | ||
key: ${{ github.job }}-${{ matrix.cmake_build_type }} | ||
|
||
- name: Clang-Format | ||
run: | | ||
find source test -iname '*.hpp' -o -iname '*.cpp' \ | ||
| xargs clang-format -Werror --dry-run --fallback-style=Google --verbose | ||
- name: Configure | ||
run: | | ||
mkdir -p build | ||
cd build | ||
cmake \ | ||
-DBST_DEVELOPER=ON \ | ||
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \ | ||
.. | ||
- name: Build | ||
working-directory: ${{github.workspace}}/build | ||
run: make | ||
|
||
- name: Unit Test | ||
working-directory: ${{github.workspace}}/build | ||
run: ./test/bst-test | ||
|
||
- name: Clang-Tidy on sources | ||
if: matrix.cmake_build_type == 'Release' | ||
run: | | ||
find source -iname '*.hpp' -o -iname '*.cpp' \ | ||
| xargs clang-tidy -p build/compile_commands.json |