From c2f1091d7ce3e35a0c711739a6b2969be5f5d48d Mon Sep 17 00:00:00 2001 From: Aaron Jomy Date: Tue, 18 Aug 2026 21:37:14 +0200 Subject: [PATCH 1/2] [ci] Add clang-format and ruff lint jobs --- .github/workflows/lint.yml | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..a0a1fcd --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,49 @@ +name: Lint + +on: + workflow_dispatch: + pull_request: + paths: + - '**.h' + - '**.cxx' + - '**.py' + - 'pyproject.toml' + - '.github/workflows/lint.yml' + +permissions: + contents: read + +concurrency: + group: lint-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + clang-format: + name: clang-format + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + # The whole tree is formatted, so check it whole: no diff-vs-base + # machinery, and drift cannot accumulate in untouched files. + - name: Check C++ formatting + run: | + sudo apt-get install -y clang-format-18 + find src test/cpp -name '*.cxx' -o -name '*.h' \ + | xargs clang-format-18 --dry-run -Werror + + ruff: + name: ruff + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Check python lint and formatting + run: | + pip install ruff==0.16.3 + ruff check . + ruff format --check . From b2ab24ae9d69c8c3532eeb8dae3df4da10fba5c5 Mon Sep 17 00:00:00 2001 From: Aaron Jomy Date: Wed, 19 Aug 2026 07:56:41 +0200 Subject: [PATCH 2/2] [ci] Update GitHub Actions to their latest versions --- .github/workflows/ci.yml | 4 ++-- .github/workflows/lint.yml | 6 +++--- .github/workflows/nightly.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd11833..83676ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,11 +54,11 @@ jobs: contents: read pull-requests: write steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v8 with: pattern: result-* - - uses: actions/github-script@v7 + - uses: actions/github-script@v9 with: script: | const fs = require('fs'); diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a0a1fcd..ac99203 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,7 @@ jobs: name: clang-format runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 # The whole tree is formatted, so check it whole: no diff-vs-base # machinery, and drift cannot accumulate in untouched files. @@ -36,9 +36,9 @@ jobs: name: ruff runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v7 with: python-version: '3.12' diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a452156..75cd1ef 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -63,7 +63,7 @@ jobs: contents: read issues: write steps: - - uses: actions/github-script@v7 + - uses: actions/github-script@v9 with: script: | const marker = '';