Skip to content

Commit

Permalink
build(repo): External contributor CI updates (#3145)
Browse files Browse the repository at this point in the history
* build(repo): External contributor CI updates

* chore(repo): Revert remove Clerk members check
  • Loading branch information
tmilewski authored Apr 9, 2024
1 parent 1ac6f4b commit 2cabc27
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 32 deletions.
2 changes: 2 additions & 0 deletions .changeset/soft-bees-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
23 changes: 7 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,19 @@ jobs:
formatting-linting:
name: Formatting, linting & changeset checks
runs-on: ${{ vars.RUNNER_LARGE }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}
timeout-minutes: 10

env:
TURBO_SUMMARIZE: false

steps:
- name: Checkout Repo
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
uses: actions/checkout@v4
with:
fetch-depth: 0
show-progress: false

- name: Setup
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
id: config
uses: ./.github/actions/init
with:
Expand All @@ -44,7 +42,6 @@ jobs:
shell: bash

- name: Require Changeset
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
if: ${{ !(github.event_name == 'merge_group') }}
run: if [ "${{ github.event.pull_request.user.login }}" = "clerk-cookie" ]; then echo 'Skipping' && exit 0; else npx changeset status --since=origin/main; fi

Expand All @@ -53,28 +50,22 @@ jobs:
shell: bash

- name: Check Formatting
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
run: npm run format:check

- name: Build Packages
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
run: npx turbo build $TURBO_ARGS --only

- name: Lint packages using publint
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
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 $TURBO_ARGS --filter=!nextjs --filter=!elements --filter=!backend --only

- name: Lint types using attw [Errors Allowed]
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
run: npx turbo lint:attw $TURBO_ARGS --filter=nextjs --filter=backend --filter=elements --continue --only
continue-on-error: true # TODO: Remove this when all related errors are fixed
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 --only -- --quiet

- name: Upload Turbo Summary
Expand All @@ -90,14 +81,14 @@ jobs:
name: Unit Tests
needs: formatting-linting
runs-on: ${{ vars.RUNNER_LARGE }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}
timeout-minutes: 10

env:
TURBO_SUMMARIZE: false

strategy:
matrix:
node-version: [ 18, 20 ]
node-version: [18, 20]

steps:
- name: Checkout Repo
Expand Down Expand Up @@ -134,12 +125,12 @@ jobs:
name: Integration Tests
needs: formatting-linting
runs-on: ${{ vars.RUNNER_MEDIUM }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}
timeout-minutes: 10

strategy:
matrix:
test-name: [ 'generic', 'nextjs', 'express', 'quickstart', 'ap-flows' ]
test-project: [ 'chrome' ]
test-name: ['generic', 'nextjs', 'express', 'quickstart', 'ap-flows']
test-project: ['chrome']

steps:
- name: Checkout Repo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-cleanups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ on:
workflow_dispatch:
schedule:
# run every 6 hours on every weekday
- cron: "0 */6 * * 1-5"
- cron: '0 */6 * * 1-5'

jobs:
integration-tests:
name: Cleanup e2e instances
runs-on: ${{ vars.RUNNER_NORMAL }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}
timeout-minutes: 10

steps:
- name: Checkout Repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lock-threads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:

jobs:
action:
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
timeout-minutes: 3
runs-on: ${{ vars.RUNNER_NORMAL }}
steps:
- uses: actions/stale@v9
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
integration-tests:
name: Integration Tests
runs-on: ${{ vars.RUNNER_NORMAL }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}
timeout-minutes: 10

strategy:
matrix:
test-name: [ 'nextjs' ]
test-name: ['nextjs']

steps:
- name: Checkout Repo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/preview.retheme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:
jobs:
preview:
runs-on: ${{ vars.RUNNER_NORMAL }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
Expand All @@ -32,7 +32,7 @@ jobs:
turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
turbo-team: ${{ vars.TURBO_TEAM }}
turbo-token: ${{ secrets.TURBO_TOKEN }}
registry-url: "https://registry.npmjs.org"
registry-url: 'https://registry.npmjs.org'

- name: Build packages
run: npx turbo build $TURBO_ARGS
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ jobs:
preview:
if: ${{ startsWith(github.event.comment.body, '!preview') && github.repository == 'clerk/javascript' && github.event.issue.pull_request }}
runs-on: ${{ vars.RUNNER_NORMAL }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}
timeout-minutes: 10

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_CLERK_PROD_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_JS_PREVIEW_PROJECT_ID }}

permissions:
contents: write
pull-requests: write

steps:
- name: Limit action to Clerk members
uses: actions/github-script@v6
Expand Down Expand Up @@ -53,7 +55,7 @@ jobs:
turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
turbo-team: ${{ vars.TURBO_TEAM }}
turbo-token: ${{ secrets.TURBO_TOKEN }}
registry-url: "https://registry.npmjs.org"
registry-url: 'https://registry.npmjs.org'

- name: Build packages
run: npx turbo build $TURBO_ARGS
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
canary-release:
if: ${{ github.repository == 'clerk/javascript' }}
runs-on: ${{ vars.RUNNER_NORMAL }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}
timeout-minutes: 10
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
Expand All @@ -34,7 +34,7 @@ jobs:
turbo-team: ${{ vars.TURBO_TEAM }}
turbo-token: ${{ secrets.TURBO_TOKEN }}
playwright-enabled: true # Must be present to enable caching on branched workflows
registry-url: "https://registry.npmjs.org"
registry-url: 'https://registry.npmjs.org'

- name: Version packages for canary
id: version-packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
snapshot-release:
if: ${{ startsWith(github.event.comment.body, '!snapshot') && github.repository == 'clerk/javascript' && github.event.issue.pull_request }}
runs-on: ${{ vars.RUNNER_LARGE }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}
timeout-minutes: 10

permissions:
contents: read
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
turbo-team: ${{ vars.TURBO_TEAM }}
turbo-token: ${{ secrets.TURBO_TOKEN }}
registry-url: "https://registry.npmjs.org"
registry-url: 'https://registry.npmjs.org'

- name: Extract snapshot name
id: extract-snapshot-name
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Release
if: ${{ github.repository == 'clerk/javascript' }}
runs-on: ${{ vars.RUNNER_NORMAL }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}
timeout-minutes: 10

permissions:
contents: write
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
commit: "chore(repo): Version packages"
commit: 'chore(repo): Version packages'
publish: npm run release
# Workaround for https://github.com/changesets/changesets/issues/421
version: npm run version
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:

strategy:
matrix:
version: [ 20 ] # NOTE: 18 is cached in the main release workflow
version: [20] # NOTE: 18 is cached in the main release workflow

steps:
- name: Checkout Repo
Expand Down

0 comments on commit 2cabc27

Please sign in to comment.