Skip to content

Commit

Permalink
build(*): Allow for GHA global cache busting (#2340)
Browse files Browse the repository at this point in the history
* build(*): Allow for GHA global cache busting

* chore(*): Clean up summarize

* chore(repo): Move now-valid packages back to fail on error
  • Loading branch information
tmilewski authored Dec 13, 2023
1 parent 05bda49 commit 050fed7
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 41 deletions.
2 changes: 2 additions & 0 deletions .changeset/famous-spies-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
3 changes: 3 additions & 0 deletions .github/.cache-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Update this file to invalidate **all** cache on GitHub actions (use sparingly)

version: v1
4 changes: 2 additions & 2 deletions .github/actions/init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ runs:
id: npm-cache
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ inputs.node-version }}-node-modules-${{ hashFiles('package-lock.json') }}
key: ${{ runner.os }}-node-${{ inputs.node-version }}-${{ hashFiles('.github/.cache-version') }}-node-modules-${{ hashFiles('package-lock.json') }}

- name: Install NPM Dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
Expand All @@ -120,7 +120,7 @@ runs:
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-playwright-${{ steps.playwright-version.outputs.VERSION }}
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('.github/.cache-version') }}-playwright-${{ steps.playwright-version.outputs.VERSION }}

- name: Install Playwright Browsers
if: inputs.playwright-enabled == 'true' && steps.playwright-cache.outputs.cache-hit != 'true'
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}

env:
TURBO_SUMMARIZE: true
TURBO_SUMMARIZE: false

steps:
- name: Checkout Repo
Expand All @@ -34,7 +34,6 @@ jobs:
id: config
uses: ./.github/actions/init
with:
turbo-remote-only: false
turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
turbo-summarize: ${{ env.TURBO_SUMMARIZE }}
turbo-team: ${{ vars.TURBO_TEAM }}
Expand All @@ -49,27 +48,26 @@ jobs:
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
run: npm run format:check

- name: Lint packages using publint
- name: Build Packages
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
run: npx turbo lint:publint $TURBO_ARGS --filter=!@clerk/clerk-js
run: npx turbo build $TURBO_ARGS --only

- name: Lint packages using publint [Errors Allowed]
- name: Lint packages using publint
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
run: npx turbo lint:publint $TURBO_ARGS --filter=@clerk/clerk-js --continue
continue-on-error: true # TODO: Remove this when all related errors are fixed
run: npx turbo lint:publint $TURBO_ARGS --only

- name: Lint types using attw
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
run: npx turbo lint:attw --filter=!@clerk/clerk-sdk-node --filter=!@clerk/nextjs --filter=!@clerk/clerk-react --filter=!@clerk/shared
run: npx turbo lint:attw --filter=!nextjs --only

- name: Lint types using attw [Errors Allowed]
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
run: npx turbo lint:attw --filter=@clerk/clerk-sdk-node --filter=@clerk/nextjs --filter=@clerk/clerk-react --filter=@clerk/shared --continue
run: npx turbo lint:attw --filter=nextjs --continue --only
continue-on-error: true # TODO: Remove this when all related errors are fixed

- name: Run lint
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
run: npx turbo lint $TURBO_ARGS -- --quiet
run: npx turbo lint $TURBO_ARGS --only -- --quiet

- name: Upload Turbo Summary
uses: actions/upload-artifact@v3
Expand All @@ -87,7 +85,7 @@ jobs:
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}

env:
TURBO_SUMMARIZE: true
TURBO_SUMMARIZE: false

strategy:
matrix:
Expand Down
22 changes: 0 additions & 22 deletions packages/clerk-js/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"build": {
"inputs": [
"*.d.ts",
"**/package.json",
"bundlewatch.config.json",
"headless/**",
"src/**",
Expand All @@ -28,7 +27,6 @@
"test": {
"inputs": [
"*.d.ts",
"**/package.json",
"bundlewatch.config.json",
"jest.*",
"src/**",
Expand All @@ -39,26 +37,6 @@
"tsup.config.ts",
"webpack.config.js",

"!**/__snapshots__/**",
"!coverage/**",
"!examples/**",
"!node_modules/**"
]
},
"test:ci": {
"dependsOn": ["build"],
"inputs": [
"*.d.ts",
"**/package.json",
"bundlewatch.config.json",
"jest.*",
"src/**",
"tests/**",
"tsconfig.json",
"tsconfig.*.json",
"tsup.config.ts",
"webpack.config.js",

"!**/__snapshots__/**",
"!coverage/**",
"!examples/**",
Expand Down
33 changes: 27 additions & 6 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"signature": true
},
"globalDependencies": [
".github/.cache-version",
"jest.*.ts",
"package.json",
"package-lock.json",
Expand All @@ -15,20 +16,19 @@
"CLERK_*",
"GATSBY_CLERK_*",
"NEXT_PUBLIC_CLERK_*",
"MAILSAC_API_KEY",
"NODE_ENV",
"NODE_VERSION",
"NPM_VERSION",
"TZ",
"VERCEL",
"VITE_CLERK_*"
],
"globalPassThroughEnv": ["AWS_SECRET_KEY", "GITHUB_TOKEN"],
"pipeline": {
"build": {
"dependsOn": ["^build"],
"inputs": [
"*.d.ts",
"**/package.json",
"bundlewatch.config.json",
"src/**",
"tsconfig.json",
Expand All @@ -44,11 +44,12 @@
"!**/__snapshots__/**",
"!CHANGELOG.md",
"!coverage/**",
"!dist/**",
"!examples/**",
"!node_modules/**"
],
"outputMode": "new-only",
"outputs": ["dist/**"]
"outputs": ["*/package.json", "dist/**", "scripts/**"]
},
"dev": {
"dependsOn": [],
Expand All @@ -67,7 +68,6 @@
"dependsOn": ["build"],
"inputs": [
"*.d.ts",
"**/package.json",
"bundlewatch.config.json",
"jest.*",
"src/**",
Expand All @@ -78,6 +78,7 @@
"!**/__snapshots__/**",
"!CHANGELOG.md",
"!coverage/**",
"!dist/**",
"!examples/**",
"!node_modules/**"
],
Expand All @@ -89,15 +90,35 @@
},
"lint": {
"dependsOn": ["^build"],
"inputs": [
"**/*.js",
"**/*.jsx",
"**/*.ts",
"**/*.tsx",
"**/*.json",
"**/*.md",
"**/*.mdx",
".github/**",

"!*/package.json",
"!**/__snapshots__/**",
"!CHANGELOG.md",
"!coverage/**",
"!dist/**",
"!examples/**",
"!node_modules/**"
],
"outputs": []
},
"lint:publint": {
"dependsOn": ["build"],
"outputs": []
"outputs": [],
"cache": false
},
"lint:attw": {
"dependsOn": [],
"outputs": []
"outputs": [],
"cache": false
},
"bundlewatch": {
"dependsOn": ["build"],
Expand Down

0 comments on commit 050fed7

Please sign in to comment.