core: clang-tidy added, cmake updated #143
Workflow file for this run
This file contains hidden or 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: datastructures-algorithms-CI-CD-flow | |
on: | |
push: | |
branches: [ main, release ] | |
pull_request: | |
branches: [ main, release ] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y cmake libgtest-dev clang-tidy | |
- name: Configure CMake | |
run: cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
- name: Run clang-tidy | |
run: | | |
find SourceCodes Headers -name '*.cpp' -o -name '*.cc' -o -name '*.cxx' -o -name '*.h' | \ | |
xargs clang-tidy -p build --warnings-as-errors=* | |
- name: Build | |
run: cmake --build build | |
- name: Run tests | |
run: ctest --test-dir build --output-on-failure |