Skip to content

NEXT-33446 - pnpm

NEXT-33446 - pnpm #29

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- uses: pnpm/action-setup@v2
with:
version: 8
# - name: Retrieve the cached "node_modules" directory (if present)
# uses: actions/cache@v3
# id: node-cache
# with:
# path: node_modules
# key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies (if the cached directory was not found)
# if: steps.node-cache.outputs.cache-hit != 'true'
run: pnpm i
- name: Check formatting
run: pnpm run format:check
- name: Perform typecheck
run: pnpm run lint:types
- name: Lint code
run: pnpm run lint:eslint
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- uses: pnpm/action-setup@v2
with:
version: 8
# - name: Retrieve the cached "node_modules" directory (if present)
# uses: actions/cache@v3
# id: node-cache
# with:
# path: node_modules
# key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies (if the cached directory was not found)
# if: steps.node-cache.outputs.cache-hit != 'true'
run: pnpm install
- name: unit
run: pnpm run test:unit
storybook-tests:
name: Storybook Tests
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
with:
version: 8
# - name: Retrieve the cached "node_modules" directory (if present)
# uses: actions/cache@v3
# id: node-cache
# with:
# path: node_modules
# key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies (if the cached directory was not found)
# if: steps.node-cache.outputs.cache-hit != 'true'
run: pnpm install
- name: Install Playwright
run: pnpm dlx playwright install
- name: Create the static pages directory locally in CI
run: pnpm --prefix ./packages/component-library run build-storybook
- name: Run Tests
id: storybookTests
run: |
cd ./packages/component-library &&
npx concurrently --kill-others --success first --names "SB,TEST" --prefix-colors "magenta,blue" \
"http-server storybook-static -a 127.0.0.1 --port 6006" \
"wait-on http://127.0.0.1:6006 && pnpm run test-storybook"
- name: Archive visual test diffs
uses: actions/upload-artifact@v3
if: always()
with:
name: visual-test-diffs
path: ./packages/component-library/__snapshots__