aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/pybind11/.github/workflows/format.yml
blob: 31d893c4792f60df10b8237d4f061b7dff4e91cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# 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*"

env:
  FORCE_COLOR: 3

jobs:
  pre-commit:
    name: Format
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-python@v4
      with:
        python-version: "3.x"
    - name: Add matchers
      run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
    - uses: pre-commit/action@v3.0.0
      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:13
    steps:
    - uses: actions/checkout@v3

    - 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);--use-color;--warnings-as-errors=*"
        -DDOWNLOAD_EIGEN=ON
        -DDOWNLOAD_CATCH=ON
        -DCMAKE_CXX_STANDARD=17

    - name: Build
      run: cmake --build build -j 2 -- --keep-going