chore: add architecture lint guardrails (#2168)

This commit is contained in:
Carlos Florêncio
2026-08-03 22:40:29 +01:00
committed by GitHub
parent 90da2d66f2
commit bb71233826
32 changed files with 2159 additions and 5 deletions
+50
View File
@@ -0,0 +1,50 @@
name: Architecture Lint
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
# Pull requests can supersede one another safely. Pushes compare each commit
# with its own before-SHA, so never cancel a push run before that comparison
# completes.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
lint:
name: Architecture boundaries do not regress
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
fetch-depth: 0
persist-credentials: false
- name: Run linter tests
run: python3 scripts/lint-architecture.test.py
- name: Lint pull request architecture
if: github.event_name == 'pull_request'
env:
ARCHITECTURE_BASE_REF: ${{ github.event.pull_request.base.sha }}
run: >-
python3 scripts/lint-architecture.py --all
--baseline-base-ref "$ARCHITECTURE_BASE_REF"
--allow-missing-base-baseline
- name: Lint pushed architecture
if: github.event_name == 'push'
env:
ARCHITECTURE_BASE_REF: ${{ github.event.before }}
run: >-
python3 scripts/lint-architecture.py --all
--baseline-base-ref "$ARCHITECTURE_BASE_REF"
--allow-missing-base-baseline