Make CI fail if there are unformatted changes.

Fixes https://b.corp.google.com/issues/411720532
This commit is contained in:
Taylor Mullen 2025-04-18 18:08:20 -04:00 committed by N. Taylor Mullen
parent 23b43ff651
commit fa264e4286
1 changed files with 11 additions and 5 deletions

View File

@ -21,7 +21,7 @@ jobs:
steps:
# 1. Checkout Code
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v4
# 2. Setup Node.js Environment
- name: Set up Node.js ${{ matrix.node-version }}
@ -35,23 +35,29 @@ jobs:
- name: Install dependencies
run: npm ci
# 4. Linting
# 4. Check Formatting
- name: Run formatter check
run: |
npm run format
git diff --exit-code
# 5. Linting
- name: Run linter
run: npm run lint
continue-on-error: true # TODO: Remove this when we have fixed lint errors
# 5. Type Checking
# 6. Type Checking
- name: Run type check
run: npm run typecheck # Or: tsc --noEmit
continue-on-error: true # TODO: Remove this when we have fixed type errors
# 6. Build
# 7. Build
# Optional if your tests run directly on TS files (e.g., using ts-jest, ts-node)
# But usually good practice to ensure the build itself works.
- name: Build project
run: npm run build
# 7. Testing
# 8. Testing
# Uncomment when we have tests.
#- name: Run tests
# run: npm test