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
28 changes: 23 additions & 5 deletions .github/workflows/code-health.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: C++ Code Health
# Stub: the linter (devtools/code_health) and its self-tests live on the fork's agents branch.
# This checks that branch out next to the code and runs it against the code checkout.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
base-ref:
description: Revision to compare with (e.g. origin/main); empty = whole tree
required: false

permissions:
contents: read
Expand All @@ -14,22 +21,33 @@ jobs:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/checkout@v7
with:
repository: dayfine/Arduino-Source
ref: agents
path: .agents-tools
- uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: pip
cache-dependency-path: devtools/code_health/requirements.txt
- run: python -m pip install -r devtools/code_health/requirements.txt
cache-dependency-path: .agents-tools/devtools/code_health/requirements.txt
- run: python -m pip install -r .agents-tools/devtools/code_health/requirements.txt
- name: Linter self-tests
working-directory: .agents-tools
env:
CODE_HEALTH_REPO: ${{ github.workspace }}
run: python -m unittest discover -s devtools/code_health/tests -v
- name: Check changed C++ files
working-directory: .agents-tools
env:
PR_BASE: ${{ github.event.pull_request.base.sha }}
INPUT_BASE: ${{ inputs.base-ref }}
PUSH_BASE: ${{ github.event.before }}
CODE: ${{ github.workspace }}
shell: bash
run: |
base="${PR_BASE:-$PUSH_BASE}"
base="${PR_BASE:-${INPUT_BASE:-$PUSH_BASE}}"
if [[ -z "$base" || "$base" == 0000000000000000000000000000000000000000 ]]; then
base=$(git hash-object -w -t tree --stdin </dev/null)
base=$(git -C "$CODE" hash-object -w -t tree --stdin </dev/null)
fi
python -m devtools.code_health --base-ref "$base" --github
python -m devtools.code_health --root "$CODE" --base-ref "$base" --github
144 changes: 0 additions & 144 deletions devtools/code_health/README.md

This file was deleted.

70 changes: 0 additions & 70 deletions devtools/code_health/__main__.py

This file was deleted.

Loading
Loading