-
Notifications
You must be signed in to change notification settings - Fork 30
49 lines (45 loc) · 1.31 KB
/
run-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Unit & Component Tests
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
jobs:
tests:
name: Run unit tests and CT tests
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
env:
VITE_APP_GIT_TAG: ${{github.ref}}
VITE_APP_GIT_SHA: ${{github.sha}}
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install pnpm
run: npm i -g pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint (show only errors)
run: pnpm lint --quiet
- name: Check exports
run: pnpm check-exports-ci
- name: Test
run: pnpm test
- name: Install Playwright
run: pnpx playwright install --with-deps
- name: Build Storybook
run: pnpm build-storybook --quiet
- name: Serve Storybook and run tests
env:
TEST_STORYBOOK_URL: http://localhost:6006
run: |
pnpx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"pnpx http-server storybook-static --port 6006 --silent" \
"pnpx wait-on tcp:6006 && pnpm test-storybook"
- name: Build
run: pnpm build