Skip to content

Update Node.js version and add semantic-release GitHub plugin #133

Update Node.js version and add semantic-release GitHub plugin

Update Node.js version and add semantic-release GitHub plugin #133

Workflow file for this run

name: Test
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
- dev
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
# Only run on push to main OR pull_request events (not both)
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.17.1"
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run unit tests
run: yarn test
- name: Run unit tests with coverage
run: yarn test:coverage
storybook-tests:
name: Storybook Tests
runs-on: ubuntu-latest
# Only run on push to main OR pull_request events (not both)
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.17.1"
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install Playwright browsers
run: yarn playwright install --with-deps
- name: Start Storybook
run: |
yarn storybook &
# Give it some initial time to start
sleep 5
- name: Wait for Storybook to be ready
run: |
timeout 120 bash -c 'until curl -s http://localhost:6006 > /dev/null; do sleep 2; done'
- name: Run Storybook tests
run: yarn test:storybook
env:
STORYBOOK_URL: http://localhost:6006