build(repo): Test change #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
merge_group: | |
pull_request: | |
branches: | |
- build/turbo-ci-poc | |
env: | |
NODE_VERSION: '18' | |
TURBO_CACHE_DIR: ./.turbo-cache | |
TURBO_CACHE_PREFIX: turbo- | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
formatting-linting: | |
name: Formatting & Linting | |
runs-on: ${{ vars.RUNNER_LARGE }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup NodeJS ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Turborepo Remote Server | |
uses: dtinth/setup-github-actions-caching-for-turbo@v1 | |
with: | |
cache-prefix: ${{ env.TURBO_CACHE_PREFIX }} | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
id: npm-cache | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-node-modules-${{ hashFiles('**/package-lock.json') }} | |
- name: Install NPM Dependencies | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
run: npm ci --audit=false --fund=false | |
- name: Require Changeset | |
run: if [ "${{ github.event.pull_request.user.login }}" = "clerk-cookie" ]; then echo 'Skipping' && exit 0; else npx changeset status --since=origin/main; fi | |
- name: Check Formatting | |
run: npm run format:check | |
- name: Lint packages using publint | |
run: npm run lint:publint -- --output-logs=errors-only --cache-dir=${{ env.TURBO_CACHE_DIR }} | |
- name: Lint types using attw | |
run: npm run lint:attw -- --output-logs=errors-only --cache-dir=${{ env.TURBO_CACHE_DIR }} | |
continue-on-error: true # TODO: Remove this when all related errors are fixed | |
- name: Run lint | |
run: npm run lint -- --output-logs=errors-only --cache-dir=${{ env.TURBO_CACHE_DIR }} -- --quiet | |
unit-tests: | |
name: Unit Tests | |
needs: formatting-linting | |
runs-on: ${{ vars.RUNNER_LARGE }} | |
strategy: | |
matrix: | |
node-version: [ 18, 19 ] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup NodeJS ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Turborepo Remote Server | |
uses: dtinth/setup-github-actions-caching-for-turbo@v1 | |
with: | |
cache-prefix: ${{ env.TURBO_CACHE_PREFIX }} | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
id: npm-cache | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-node-modules-${{ hashFiles('**/package-lock.json') }} | |
- name: Install NPM Dependencies | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
run: npm ci --audit=false --fund=false | |
- name: Run tests | |
run: npm run test:ci -- --output-logs=errors-only --cache-dir=${{ env.TURBO_CACHE_DIR }} | |
integration-tests: | |
name: Integration Tests | |
needs: formatting-linting | |
runs-on: ${{ vars.RUNNER_LARGE }} | |
strategy: | |
matrix: | |
test-name: [ 'generic', 'nextjs', 'remix' ] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup NodeJS ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Turborepo Remote Server | |
uses: dtinth/setup-github-actions-caching-for-turbo@v1 | |
with: | |
cache-prefix: ${{ env.TURBO_CACHE_PREFIX }} | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
id: npm-cache | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-node-modules-${{ hashFiles('**/package-lock.json') }} | |
- name: Install NPM Dependencies | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
run: npm ci --audit=false --fund=false | |
- name: Update NPM Registry | |
run: npm set registry http://localhost:4873/ | |
- name: Run Verdaccio | |
run: nohup ./node_modules/.bin/verdaccio --config ./verdaccio.yaml & sleep 5 | |
- name: Get Playwright Version | |
id: playwright-version | |
run: echo "VERSION=$(node -e "console.log($(npm ls @playwright/test --json).dependencies['@playwright/test'].version)")" >> "$GITHUB_OUTPUT" | |
- name: Cache Playwright Binaries | |
uses: actions/cache@v3 | |
id: playwright-cache | |
with: | |
path: ~/.cache/ms-playwright | |
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-playwright-${{ steps.playwright-version.outputs.VERSION }} | |
- name: Install Playwright Browsers | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
run: npx playwright install --with-deps | |
- name: Publish to Verdaccio | |
run: npm run release:verdaccio # Fails early if the default npm registry is used | |
- name: Install @clerk/backend in /integration | |
working-directory: ./integration | |
run: npm init -y && npm install @clerk/backend | |
- name: Run Playwright tests | |
run: npm run test:integration:${{ matrix.test-name }} | |
env: | |
INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }} | |
MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }} | |
E2E_CLERK_VERSION: 'latest' | |
# - name: Upload Playwright Report for ${{ matrix.test-name }} | |
# uses: actions/upload-artifact@v3 | |
# if: always() | |
# with: | |
# name: playwright-report-${{ github.ref }}-${{ matrix.test-name }} | |
# path: playwright-report/ | |
# retention-days: 30 |