2020-09-16 21:13:41 +00:00
|
|
|
# This is a format job. Pre-commit has a first-party GitHub action, so we use
|
|
|
|
# that: https://github.com/pre-commit/action
|
|
|
|
|
2020-07-20 17:35:21 +00:00
|
|
|
name: Format
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- stable
|
|
|
|
- "v*"
|
|
|
|
|
2023-05-15 17:02:25 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2022-02-15 22:48:33 +00:00
|
|
|
env:
|
|
|
|
FORCE_COLOR: 3
|
2022-12-15 21:19:13 +00:00
|
|
|
# For cmake:
|
|
|
|
VERBOSE: 1
|
2022-02-15 22:48:33 +00:00
|
|
|
|
2020-07-20 17:35:21 +00:00
|
|
|
jobs:
|
|
|
|
pre-commit:
|
|
|
|
name: Format
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-07-04 14:24:55 +00:00
|
|
|
- uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.x"
|
2022-02-15 22:48:33 +00:00
|
|
|
- name: Add matchers
|
|
|
|
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
|
2022-06-08 13:22:57 +00:00
|
|
|
- uses: pre-commit/action@v3.0.0
|
2020-09-16 21:13:41 +00:00
|
|
|
with:
|
|
|
|
# Slow hooks are marked with manual - slow is okay here, run them too
|
2020-10-05 19:31:00 +00:00
|
|
|
extra_args: --hook-stage manual --all-files
|
2020-09-11 01:16:40 +00:00
|
|
|
|
|
|
|
clang-tidy:
|
2021-06-22 22:12:58 +00:00
|
|
|
# When making changes here, please also review the "Clang-Tidy" section
|
|
|
|
# in .github/CONTRIBUTING.md and update as needed.
|
2020-09-11 01:16:40 +00:00
|
|
|
name: Clang-Tidy
|
|
|
|
runs-on: ubuntu-latest
|
2022-12-27 20:14:10 +00:00
|
|
|
container: silkeh/clang:15-bullseye
|
2020-09-11 01:16:40 +00:00
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-09-11 01:16:40 +00:00
|
|
|
|
|
|
|
- name: Install requirements
|
2022-12-27 20:14:10 +00:00
|
|
|
run: apt-get update && apt-get install -y git python3-dev python3-pytest
|
2020-09-11 01:16:40 +00:00
|
|
|
|
|
|
|
- name: Configure
|
2020-11-09 18:10:19 +00:00
|
|
|
run: >
|
|
|
|
cmake -S . -B build
|
2022-07-13 14:06:32 +00:00
|
|
|
-DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy);--use-color;--warnings-as-errors=*"
|
2020-11-09 18:10:19 +00:00
|
|
|
-DDOWNLOAD_EIGEN=ON
|
|
|
|
-DDOWNLOAD_CATCH=ON
|
|
|
|
-DCMAKE_CXX_STANDARD=17
|
2020-09-11 01:16:40 +00:00
|
|
|
|
|
|
|
- name: Build
|
2021-06-22 16:11:54 +00:00
|
|
|
run: cmake --build build -j 2 -- --keep-going
|