chore: add architecture lint guardrails (#2168)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user