Skip to content

Chore/clang format

Chore/clang format #2

Workflow file for this run

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/).*'