Skip to content

Commit

Permalink
fix(repo): Enable Turbo summarize
Browse files Browse the repository at this point in the history
  • Loading branch information
tmilewski committed Nov 3, 2023
1 parent b7ef2d8 commit a907d96
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 87 deletions.
8 changes: 7 additions & 1 deletion .github/actions/init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ inputs:
description: 'Enable Playwright?'
required: false
default: 'false'
turbo-summarize:
description: 'The token to use for Turbo task summaries'
required: false
default: 'false'
turbo-enabled:
description: 'Enable Turbo?'
required: false
Expand Down Expand Up @@ -44,6 +48,7 @@ runs:
CACHE_DIR: ${{ inputs.turbo-cache-dir }}
REMOTE_ONLY: ${{ inputs.turbo-remote-only }}
SIGNATURE: ${{ inputs.turbo-signature }}
SUMMARIZE: ${{ inputs.turbo-summarize }}
TEAM: ${{ inputs.turbo-team }}
TOKEN: ${{ inputs.turbo-token }}
with:
Expand All @@ -54,13 +59,14 @@ runs:
? os.availableParallelism()
: os.cpus().length;
const { ENABLED, CACHE_DIR, SIGNATURE, REMOTE_ONLY, TEAM, TOKEN } = process.env
const { ENABLED, CACHE_DIR, SIGNATURE, REMOTE_ONLY, SUMMARIZE, TEAM, TOKEN } = process.env
core.exportVariable('TURBO_ARGS',
[
'--output-logs=new-only',
`--cache-dir=${CACHE_DIR}`,
`--concurrency=${cpus}`
'--summarize=${SUMMARIZE}',
].join(' ')
)
Expand Down
183 changes: 97 additions & 86 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ concurrency:
jobs:
formatting-linting:
name: Formatting, linting & changeset checks
runs-on: ${{ vars.RUNNER_MEDIUM }}
runs-on: ${{ vars.RUNNER_LARGE }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}
env:
TURBO_SUMMARIZE: true

steps:
- name: Checkout Repo
Expand All @@ -34,6 +36,7 @@ jobs:
with:
turbo-remote-only: false
turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
turbo-summarize: ${{ env.TURBO_SUMMARIZE }}
turbo-team: ${{ vars.TURBO_TEAM }}
turbo-token: ${{ secrets.TURBO_TOKEN }}

Expand Down Expand Up @@ -67,89 +70,97 @@ jobs:
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
run: npm run lint -- $TURBO_ARGS -- --quiet

unit-tests:
name: Unit Tests
needs: formatting-linting
runs-on: ${{ vars.RUNNER_LARGE }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}

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

steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
show-progress: false

- name: Setup
id: config
uses: ./.github/actions/init
with:
node-version: ${{ matrix.node-version }}
turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
turbo-team: ${{ vars.TURBO_TEAM }}
turbo-token: ${{ secrets.TURBO_TOKEN }}

- name: Run tests
run: npx turbo test $TURBO_ARGS
env:
NODE_VERSION: ${{ matrix.node-version }}

integration-tests:
name: Integration Tests
needs: formatting-linting
runs-on: ${{ vars.RUNNER_LARGE }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}

strategy:
matrix:
test-name: [ 'generic', 'nextjs', 'remix' ]

steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
show-progress: false

- name: Setup
id: config
uses: ./.github/actions/init
with:
turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
turbo-team: ${{ vars.TURBO_TEAM }}
turbo-token: ${{ secrets.TURBO_TOKEN }}
playwright-enabled: true

- name: Verdaccio
uses: ./.github/actions/verdaccio
- name: Upload Turbo Summary
uses: actions/upload-artifact@v3
if: ${{ env.TURBO_SUMMARIZE == 'true' }}
with:
publish-cmd: |
if [ "$(npm config get registry)" = "https://registry.npmjs.org/" ]; then echo 'Error: Using default registry' && exit 1; else npx turbo build $TURBO_ARGS && npx changeset publish --no-git-tag; fi
- name: Install @clerk/backend in /integration
working-directory: ./integration
run: npm init -y && npm install @clerk/backend

- name: Install @clerk/clerk-js in os temp
working-directory: ${{runner.temp}}
run: mkdir clerk-js && cd clerk-js && npm init -y && npm install @clerk/clerk-js

- name: Run Integration Tests
run: npm run test:integration:${{ matrix.test-name }}
env:
E2E_APP_CLERK_JS_DIR: ${{runner.temp}}
E2E_CLERK_VERSION: 'latest'
INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }}
MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }}

# - name: Upload Integration Report for ${{ matrix.test-name }}
# uses: actions/upload-artifact@v3
# if: always()
# with:
# name: integration-report-${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.test-name }}
# path: playwright-report/
# retention-days: 1
name: turbo-summary-report-${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}
path: ./turbo/runs
retention-days: 1

# unit-tests:
# name: Unit Tests
# needs: formatting-linting
# runs-on: ${{ vars.RUNNER_LARGE }}
# timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}

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

# steps:
# - name: Checkout Repo
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# show-progress: false

# - name: Setup
# id: config
# uses: ./.github/actions/init
# with:
# node-version: ${{ matrix.node-version }}
# turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
# turbo-team: ${{ vars.TURBO_TEAM }}
# turbo-token: ${{ secrets.TURBO_TOKEN }}

# - name: Run tests
# run: npx turbo test $TURBO_ARGS
# env:
# NODE_VERSION: ${{ matrix.node-version }}

# integration-tests:
# name: Integration Tests
# needs: formatting-linting
# runs-on: ${{ vars.RUNNER_LARGE }}
# timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}

# strategy:
# matrix:
# test-name: [ 'generic', 'nextjs', 'remix' ]

# steps:
# - name: Checkout Repo
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# show-progress: false

# - name: Setup
# id: config
# uses: ./.github/actions/init
# with:
# turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
# turbo-team: ${{ vars.TURBO_TEAM }}
# turbo-token: ${{ secrets.TURBO_TOKEN }}
# playwright-enabled: true

# - name: Verdaccio
# uses: ./.github/actions/verdaccio
# with:
# publish-cmd: |
# if [ "$(npm config get registry)" = "https://registry.npmjs.org/" ]; then echo 'Error: Using default registry' && exit 1; else npx turbo build $TURBO_ARGS && npx changeset publish --no-git-tag; fi

# - name: Install @clerk/backend in /integration
# working-directory: ./integration
# run: npm init -y && npm install @clerk/backend

# - name: Install @clerk/clerk-js in os temp
# working-directory: ${{runner.temp}}
# run: mkdir clerk-js && cd clerk-js && npm init -y && npm install @clerk/clerk-js

# - name: Run Integration Tests
# run: npm run test:integration:${{ matrix.test-name }}
# env:
# E2E_APP_CLERK_JS_DIR: ${{runner.temp}}
# E2E_CLERK_VERSION: 'latest'
# INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }}
# MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }}

# # - name: Upload Integration Report for ${{ matrix.test-name }}
# # uses: actions/upload-artifact@v3
# # if: always()
# # with:
# # name: integration-report-${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.test-name }}
# # path: playwright-report/
# # retention-days: 1

0 comments on commit a907d96

Please sign in to comment.