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

View File

@@ -21,7 +21,7 @@ jobs:
steps: steps:
# 1. Checkout Code # 1. Checkout Code
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
# 2. Setup Node.js Environment # 2. Setup Node.js Environment
- name: Set up Node.js ${{ matrix.node-version }} - name: Set up Node.js ${{ matrix.node-version }}
@@ -35,23 +35,29 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: npm ci 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 - name: Run linter
run: npm run lint run: npm run lint
continue-on-error: true # TODO: Remove this when we have fixed lint errors continue-on-error: true # TODO: Remove this when we have fixed lint errors
# 5. Type Checking # 6. Type Checking
- name: Run type check - name: Run type check
run: npm run typecheck # Or: tsc --noEmit run: npm run typecheck # Or: tsc --noEmit
continue-on-error: true # TODO: Remove this when we have fixed type errors 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) # 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. # But usually good practice to ensure the build itself works.
- name: Build project - name: Build project
run: npm run build run: npm run build
# 7. Testing # 8. Testing
# Uncomment when we have tests. # Uncomment when we have tests.
#- name: Run tests #- name: Run tests
# run: npm test # run: npm test