Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/test-react.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Test React components library
permissions:
contents: read

on:
pull_request:
paths:
- src/react/**
workflow_dispatch:

jobs:
test:
name: React tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src/react

steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Read .nvmrc
run: echo "GITHUB_NVMRC_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.GITHUB_NVMRC_VERSION }}

- name: Install dependencies
run: npm ci

# Errors in lint process will cause this job to fail
- name: Lint
run: npm run lint

# Errors in Prettier format check will cause this job to fail
- name: Prettier format check
run: npm run format:check

- name: Run test suite
run: npm run test

# Treat failures in the Vite build as test failures.
# We don't need to keep the artifact of this build,
# we just care that it completes successfully.
- name: Run Vite build
run: npm run build-vite

# Treat failures in the main build script as test failures
- name: Run build
run: npm run build
1 change: 1 addition & 0 deletions src/react/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
Loading