pybind11/.github/workflows/format.yml
Ralf W. Grosse-Kunstleve 484b0f0433
Updating and slightly enhancing instructions for running clang-tidy. (#3055)
* Updating and slightly enhancing instructions for running clang-tidy.

* Making documented commands identical to workflow commands. Adding comment in workflow file pointing to documentation.
2021-06-22 15:12:58 -07:00

49 lines
1.2 KiB
YAML

# This is a format job. Pre-commit has a first-party GitHub action, so we use
# that: https://github.com/pre-commit/action
name: Format
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- stable
- "v*"
jobs:
pre-commit:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
with:
# Slow hooks are marked with manual - slow is okay here, run them too
extra_args: --hook-stage manual --all-files
clang-tidy:
# When making changes here, please also review the "Clang-Tidy" section
# in .github/CONTRIBUTING.md and update as needed.
name: Clang-Tidy
runs-on: ubuntu-latest
container: silkeh/clang:12
steps:
- uses: actions/checkout@v2
- name: Install requirements
run: apt-get update && apt-get install -y python3-dev python3-pytest
- name: Configure
run: >
cmake -S . -B build
-DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy)"
-DDOWNLOAD_EIGEN=ON
-DDOWNLOAD_CATCH=ON
-DCMAKE_CXX_STANDARD=17
- name: Build
run: cmake --build build -j 2 -- --keep-going