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
27 changes: 27 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build & Test

on:
pull_request:
push:
branches: [main]

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Clang 17
run: |
sudo apt-get update
sudo apt-get install -y clang-17 clang-tidy-17
- name: Configure build
run: |
CC=clang-17 CXX=clang++-17 cmake -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Build
run: |
cmake --build build -- -j$(nproc)
- name: Run tests
run: |
build/src/test/pdf-test-main
23 changes: 23 additions & 0 deletions .github/workflows/clang-format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: clang-format

on:
pull_request:
push:
branches: [main]

jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 2
- uses: jayllyz/clang-format-action@v1
with:
clang-version: 17
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: clang format files"
branch: ${{ github.head_ref }}
28 changes: 28 additions & 0 deletions .github/workflows/clang-tidy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: clang-tidy

on:
pull_request:
push:
branches: [main]

jobs:
tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Clang 17
run: |
sudo apt-get update
sudo apt-get install -y clang-17 clang-tidy-17
- name: Configure build
run: |
CC=clang-17 CXX=clang++-17 cmake -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Run clang-tidy
run: |
find . -iname '*.c' | \
xargs clang-tidy-17 \
-extra-arg="-UTEST" \
--config-file=./.clang-tidy \
-p build
13 changes: 13 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pre-commit/action@v3.0.1
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.5
hooks:
- id: clang-format
- repo: https://github.com/crate-ci/typos
rev: v1.16.5
hooks:
Expand Down