-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (54 loc) · 1.81 KB
/
node-ci.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
name: Node CI
on:
push:
paths-ignore:
- 'docs/**'
- '**.md**'
branches: [ main ]
pull_request:
paths-ignore:
- 'docs/**'
- '**.md**'
branches: [ main ]
workflow_dispatch:
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 100
- name: Read Node.js version from package.json
run: echo "nodeVersion=$(node -p "require('./package.json').engines.node")" >> $GITHUB_OUTPUT
id: engines
- name: Set up node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version: ${{ steps.engines.outputs.nodeVersion }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ steps.yarn-cache-dir-path.outputs.dir }}
# The yarn cache is not node_modules
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Generate GraphQL types
run: yarn generate
- name: Lint code
run: yarn lint
- name: Run Jest tests
run: yarn test:unit --coverage --silent
- name: Build Storybook
run: yarn storybook:build
- name: start Happo run
run: yarn happo-ci-github-actions
env:
HAPPO_API_KEY: ${{ secrets.HAPPO_API_KEY }}
HAPPO_API_SECRET: ${{ secrets.HAPPO_API_SECRET }}