From 050fed7d5b2c90a56e70ad677500c5f03d85ac5e Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Wed, 13 Dec 2023 16:57:57 -0500 Subject: [PATCH] build(*): Allow for GHA global cache busting (#2340) * build(*): Allow for GHA global cache busting * chore(*): Clean up summarize * chore(repo): Move now-valid packages back to fail on error --- .changeset/famous-spies-clean.md | 2 ++ .github/.cache-version | 3 +++ .github/actions/init/action.yml | 4 ++-- .github/workflows/ci.yml | 20 +++++++++---------- packages/clerk-js/turbo.json | 22 --------------------- turbo.json | 33 ++++++++++++++++++++++++++------ 6 files changed, 43 insertions(+), 41 deletions(-) create mode 100644 .changeset/famous-spies-clean.md create mode 100644 .github/.cache-version diff --git a/.changeset/famous-spies-clean.md b/.changeset/famous-spies-clean.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/famous-spies-clean.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/.cache-version b/.github/.cache-version new file mode 100644 index 0000000000..ecc6906284 --- /dev/null +++ b/.github/.cache-version @@ -0,0 +1,3 @@ +# Update this file to invalidate **all** cache on GitHub actions (use sparingly) + +version: v1 diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml index d710718931..3137ccd103 100644 --- a/.github/actions/init/action.yml +++ b/.github/actions/init/action.yml @@ -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' @@ -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' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f26da23ba4..8c6c79d477 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }} env: - TURBO_SUMMARIZE: true + TURBO_SUMMARIZE: false steps: - name: Checkout Repo @@ -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 }} @@ -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 @@ -87,7 +85,7 @@ jobs: timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }} env: - TURBO_SUMMARIZE: true + TURBO_SUMMARIZE: false strategy: matrix: diff --git a/packages/clerk-js/turbo.json b/packages/clerk-js/turbo.json index 07391097f9..cba532c8e4 100644 --- a/packages/clerk-js/turbo.json +++ b/packages/clerk-js/turbo.json @@ -4,7 +4,6 @@ "build": { "inputs": [ "*.d.ts", - "**/package.json", "bundlewatch.config.json", "headless/**", "src/**", @@ -28,7 +27,6 @@ "test": { "inputs": [ "*.d.ts", - "**/package.json", "bundlewatch.config.json", "jest.*", "src/**", @@ -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/**", diff --git a/turbo.json b/turbo.json index 569c2f6206..c7ff335504 100644 --- a/turbo.json +++ b/turbo.json @@ -4,6 +4,7 @@ "signature": true }, "globalDependencies": [ + ".github/.cache-version", "jest.*.ts", "package.json", "package-lock.json", @@ -15,7 +16,6 @@ "CLERK_*", "GATSBY_CLERK_*", "NEXT_PUBLIC_CLERK_*", - "MAILSAC_API_KEY", "NODE_ENV", "NODE_VERSION", "NPM_VERSION", @@ -23,12 +23,12 @@ "VERCEL", "VITE_CLERK_*" ], + "globalPassThroughEnv": ["AWS_SECRET_KEY", "GITHUB_TOKEN"], "pipeline": { "build": { "dependsOn": ["^build"], "inputs": [ "*.d.ts", - "**/package.json", "bundlewatch.config.json", "src/**", "tsconfig.json", @@ -44,11 +44,12 @@ "!**/__snapshots__/**", "!CHANGELOG.md", "!coverage/**", + "!dist/**", "!examples/**", "!node_modules/**" ], "outputMode": "new-only", - "outputs": ["dist/**"] + "outputs": ["*/package.json", "dist/**", "scripts/**"] }, "dev": { "dependsOn": [], @@ -67,7 +68,6 @@ "dependsOn": ["build"], "inputs": [ "*.d.ts", - "**/package.json", "bundlewatch.config.json", "jest.*", "src/**", @@ -78,6 +78,7 @@ "!**/__snapshots__/**", "!CHANGELOG.md", "!coverage/**", + "!dist/**", "!examples/**", "!node_modules/**" ], @@ -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"],