Update docs and fix tests #2
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: CI Tests | |
on: | |
pull_request: | |
branches: ["main","develop"] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
cache-dependency-path: "**/package-lock.json" | |
- name: Cache or restore dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: ${{ runner.os }}-npm- | |
- name: Install dependencies | |
run: npm ci | |
- name: Check formatting and linting | |
run: npm run prettier && npm run lint | |
- name: Check package build | |
run: npm run build | |
- name: Get Playwright version | |
run: echo "PLAYWRIGHT_VERSION=$(jq -r '.devDependencies["@playwright/test"]' package.json)" >> $GITHUB_ENV | |
- name: Cache or restore Playwright binaries | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
restore-keys: ${{ runner.os }}-playwright- | |
- name: Install Playwright | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
run: npm run pretest | |
- name: Storybook test build | |
run: npm run storybook:build -- --test | |
- name: Storybook test suite | |
run: npm run test:ci |