From fa264e42863474a809d06ef569f7ad5388d48072 Mon Sep 17 00:00:00 2001 From: Taylor Mullen Date: Fri, 18 Apr 2025 18:08:20 -0400 Subject: [PATCH] Make CI fail if there are unformatted changes. Fixes https://b.corp.google.com/issues/411720532 --- .github/workflows/ci.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df4a45d7..ca0c6936 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 \ No newline at end of file