Skip to content

Commit 7ac76dd

Browse files
authored
fix(repo): Ensure build runs before lint in CI (clerk#1902)
1 parent 1ffb41e commit 7ac76dd

7 files changed

Lines changed: 29 additions & 36 deletions

File tree

.changeset/olive-foxes-knock.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.github/actions/setup/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ inputs:
55
description: 'The node version to use'
66
required: false
77
default: '18'
8+
use-turbo-cache:
9+
description: 'Whether or not the turbo cache should be restored. Defaults to false.'
10+
required: false
811

912
runs:
1013
using: "composite"
@@ -27,3 +30,9 @@ runs:
2730
name: Install dependencies
2831
shell: bash
2932
run: npm ci
33+
- if: ${{ inputs.use-turbo-cache == 'true' }}
34+
name: Download turbo cache
35+
uses: actions/download-artifact@v3
36+
with:
37+
name: package-artifacts
38+
path: ./node_modules/.cache/turbo

.github/workflows/base-lint.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/base-registry.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ jobs:
88
- uses: actions/checkout@v3
99
- name: Setup
1010
uses: ./.github/actions/setup
11-
- name: Download turbo cache
12-
uses: actions/download-artifact@v3
13-
with:
14-
name: package-artifacts
15-
path: ./node_modules/.cache/turbo
1611
- name: Configure npm to use Verdaccio
1712
run: |
1813
npm set registry http://localhost:4873/

.github/workflows/checks.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ jobs:
1212
name: Prettier
1313
uses: ./.github/workflows/base-prettier.yml
1414

15-
eslint:
16-
name: Eslint
17-
uses: ./.github/workflows/base-lint.yml
18-
1915
changeset:
2016
name: Require changeset
2117
uses: ./.github/workflows/base-changeset.yml
@@ -26,6 +22,19 @@ jobs:
2622
needs: [ prettier, changeset ]
2723
uses: ./.github/workflows/base-build.yml
2824

25+
eslint:
26+
name: ESLint
27+
needs: build
28+
runs-on: ${{ vars.RUNNER_LARGE }}
29+
steps:
30+
- uses: actions/checkout@v3
31+
- name: Setup
32+
uses: ./.github/actions/setup
33+
with:
34+
use-turbo-cache: 'true'
35+
- name: Run lint
36+
run: npm run lint
37+
2938
unit-tests:
3039
name: Run unit tests
3140
needs: build
@@ -37,11 +46,8 @@ jobs:
3746
- uses: actions/checkout@v3
3847
- name: Setup
3948
uses: ./.github/actions/setup
40-
- name: Download turbo cache
41-
uses: actions/download-artifact@v3
4249
with:
43-
name: package-artifacts
44-
path: ./node_modules/.cache/turbo
50+
use-turbo-cache: 'true'
4551
- name: Run tests
4652
run: npm run test:ci
4753

@@ -53,11 +59,8 @@ jobs:
5359
- uses: actions/checkout@v3
5460
- name: Setup
5561
uses: ./.github/actions/setup
56-
- name: Download turbo cache
57-
uses: actions/download-artifact@v3
5862
with:
59-
name: package-artifacts
60-
path: ./node_modules/.cache/turbo
63+
use-turbo-cache: 'true'
6164
- name: Lint packages using publint
6265
run: npm run lint:publint
6366

@@ -69,11 +72,8 @@ jobs:
6972
- uses: actions/checkout@v3
7073
- name: Setup
7174
uses: ./.github/actions/setup
72-
- name: Download turbo cache
73-
uses: actions/download-artifact@v3
7475
with:
75-
name: package-artifacts
76-
path: ./node_modules/.cache/turbo
76+
use-turbo-cache: 'true'
7777
- name: Lint types using attw
7878
# Remove this when all related errors are fixed
7979
continue-on-error: true

packages/nextjs/src/ssr/utils/authenticateRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { WithServerSideAuthOptions } from '../types';
66
/**
77
* @internal
88
*/
9-
export async function authenticateRequest(ctx: GetServerSidePropsContext, opts: WithServerSideAuthOptions = {}) {
9+
export function authenticateRequest(ctx: GetServerSidePropsContext, opts: WithServerSideAuthOptions = {}) {
1010
const { headers, cookies } = ctx.req;
1111

1212
const cookieToken = cookies['__session'];

turbo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"outputs": []
6464
},
6565
"lint": {
66-
"dependsOn": [],
66+
"dependsOn": ["build"],
6767
"outputs": []
6868
},
6969
"lint:publint": {

0 commit comments

Comments
 (0)