-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (58 loc) · 1.66 KB
/
master.yaml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Master
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Test, build and publish to Chromatic
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout project
uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to retrieve git history for Chromatic
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: current
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Create mock service worker
run: npm run msw
- name: Run unit tests
run: npm run coverage
- name: Build website
run: npm run build
- name: Report coverage
uses: codecov/codecov-action@v3
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
autoAcceptChanges: master
buildScriptName: build-storybook
exitOnceUploaded: true
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
e2e:
name: Run E2E tests
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run Cypress
uses: cypress-io/github-action@v4
with:
build: npm run e2e:build
start: npm start