more formatting stuff #1
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: "CI" | |
on: | |
pull_request: | |
push: | |
branches: [ main, master ] | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@main | |
- name: Setup Nix Cache | |
uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Build | |
run: nix build | |
- name: Check formatting | |
run: | | |
nix develop -c clang-format -i $(find . -name '*.cpp' -o -name '*.hpp') | |
# Check if any files were modified | |
git diff --exit-code || (echo "Code is not properly formatted!"; exit 1) | |
- name: Run static analysis | |
run: | | |
nix develop -c cppcheck --enable=all --error-exitcode=1 . | |
- name: Run valgrind | |
run: | | |
nix develop -c valgrind --error-exitcode=1 --leak-check=full ./result/bin/terminder |