-
Notifications
You must be signed in to change notification settings - Fork 81
75 lines (56 loc) · 1.54 KB
/
build-and-test.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build and Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '18' ]
name: Node ${{ matrix.node }} tests
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Run tests with coverage
run: yarn test:coverage
- name: Run node server side tests
run: yarn test:serverside
run-checks:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'yarn'
# The yarn cache is not node_modules
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Lint code
run: yarn lint
- name: Check format
run: yarn format:check
- name: Build Storybook
run: yarn build-storybook
- name: Happo
run: yarn happo-ci
env:
HAPPO_API_KEY: ${{ secrets.HAPPO_API_KEY }}
HAPPO_API_SECRET: ${{ secrets.HAPPO_API_SECRET }}
- name: Run Danger JS
run: yarn danger ci --failOnErrors
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}