Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Check formatting

on:
pull_request:
paths:
- '**'
- '!.gitignore'
- '!*.md'
- '!.github/**'
- '.github/workflows/clang-format.yml'

permissions:
contents: read
pull-requests: write

jobs:
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Fetch base commit
run: git fetch origin ${{ github.event.pull_request.base.sha }}

- name: Install clang-format-20
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo add-apt-repository -y "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main"
sudo apt-get install -y -qq clang-format-20

- uses: reviewdog/action-setup@v1

- name: Check formatting on changed lines
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git clang-format-20 --binary clang-format-20 \
--diff ${{ github.event.pull_request.base.sha }} -- \
'*.c' '*.cpp' '*.cc' '*.h' '*.hpp' \
| reviewdog \
-name="clang-format" \
-f=diff \
-reporter=github-pr-check \
-fail-level=error \
-filter-mode=added
11 changes: 6 additions & 5 deletions .github/workflows/nightly-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ on:
push:
branches:
- 'main'
paths-ignore:
- '.gitignore'
- '*.md'
- '.github/**'
- '!.github/workflows/nightly-server.yml'
paths:
- '**'
- '!.gitignore'
- '!*.md'
- '!.github/**'
- '.github/workflows/nightly-server.yml'

permissions:
contents: write
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ on:
push:
branches:
- 'main'
paths-ignore:
- '.gitignore'
- '*.md'
- '.github/**'
- '!.github/workflows/nightly.yml'
paths:
- '**'
- '!.gitignore'
- '!*.md'
- '!.github/**'
- '.github/workflows/nightly.yml'

permissions:
contents: write
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
paths-ignore:
- '.gitignore'
- '*.md'
- '.github/*.md'
paths:
- '**'
- '!.gitignore'
- '!*.md'
- '!.github/**'
- '.github/workflows/pull-request.yml'

jobs:
build:
Expand Down
Loading