Chore/clang format #2
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: Jobs | |
| on: | |
| push: | |
| branches: ["main", "dev"] | |
| pull_request: | |
| branches: ["main", "dev"] | |
| jobs: | |
| build: | |
| 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 g++ | |
| - name: Configure CMake | |
| run: cmake -S . -B build | |
| - name: Build | |
| run: cmake --build build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: built | |
| path: ./build | |
| test: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: built | |
| path: ./build | |
| - name: Make test binary executable | |
| run: chmod +x build/bin/RandomizerTests | |
| - name: run-tests | |
| run: ctest --test-dir build --output-on-failure | |
| format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Install clang-format | |
| run: sudo apt update && sudo apt-get install -y clang clang-format-14 | |
| - name: Run clang-format | |
| run: find include src \( -name '*.cpp' -o -name '*.hpp' \) -exec clang-format-14 --dry-run --Werror {} + | |
| lint: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: built | |
| path: ./build | |
| - name: Install clang-tidy | |
| run: sudo apt-get update && sudo apt-get install -y cmake clang clang-tidy g++ | |
| - name: lint | |
| run: ./run-clang-tidy.py -p build -source-filter '^(?!.*_deps/googletest-src/).*' |