Skip to content

Commit 9515960

Browse files
committed
Only lint and format once pre-push
1 parent da23aa4 commit 9515960

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ jobs:
1818
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
1919
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
2020
steps:
21-
# Checkout the repository
2221
- name: Checkout code
2322
uses: actions/checkout@v4
2423
with:
2524
fetch-depth: 0
2625

27-
# Set up Node.js with caching for npm dependencies
2826
- name: Setup Node.js
2927
uses: actions/setup-node@v3
3028
with:
@@ -41,18 +39,20 @@ jobs:
4139
restore-keys: |
4240
nx-cache-${{ runner.os }}-
4341
44-
# Install dependencies
4542
- name: Install dependencies
4643
run: npm ci
4744

48-
# Set commit shas for Nx if needed
45+
- name: Format and lint everything
46+
run: |
47+
npm run format
48+
npm run lint
49+
4950
- name: Set Nx SHAs
5051
uses: nrwl/nx-set-shas@v4
5152

52-
# Run Nx tasks including the staging deployment and extract the URL.
53-
- name: Run Nx tasks including staging deployment
53+
- name: Run Nx tasks
5454
id: checks
55-
run: npx nx affected -t lint test:ci type-check build # deploy:staging
55+
run: npx nx affected -t lint test:ci type-check build
5656

5757
- name: Cache Nx folder
5858
uses: actions/cache@v3

.github/workflows/smoke.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ jobs:
3535
uses: nrwl/nx-set-shas@v4
3636

3737
# Run Nx tasks including the staging deployment and extract the URL.
38-
- name: Run Nx tasks including staging deployment
38+
- name: Run smoke tests
3939
id: checks
40-
run: npx nx run-many -t lint test:smoke type-check build
40+
run: npx nx run-many -t test:smoke

.husky/pre-push

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ if [ "$ORIGINAL_HASH" != "$NEW_HASH" ]; then
3737
exit 1
3838
fi
3939

40-
# 6. Run Nx format across all projects.
41-
npx nx run-many -t format lint:fix
40+
# 6. Format and lint everything
4241
npm run format
4342
npm run lint:fix
4443

@@ -52,4 +51,4 @@ if [ -n "$(git status --porcelain)" ]; then
5251
fi
5352

5453
# 8. Continue with the remaining pre-push commands.
55-
npx nx affected --base=main --head=HEAD -t lint types test:ci type-check build
54+
npx nx affected --base=main --head=HEAD -t types test:ci type-check build

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"create-demo": "npx tsx ./tools/create-demo/index.ts",
66
"prepare": "husky",
77
"format": "biome format --write",
8+
"lint": "biome lint",
89
"lint:fix": "biome lint --fix"
910
},
1011
"devDependencies": {

0 commit comments

Comments
 (0)