-
Notifications
You must be signed in to change notification settings - Fork 4
111 lines (95 loc) · 2.99 KB
/
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Build & Test CI
on:
push:
workflow_call:
secrets:
CHROMATIC_PROJECT_TOKEN:
required: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node 😻
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'yarn'
- name: Install Dependencies ⬆️
run: yarn install --immutable
- name: Type check 📋
run: yarn run types
- name: Run CI Tests ✅
run: yarn run test:ci
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CI: true
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node 😻
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'yarn'
- name: Install Dependencies ⬆️
run: yarn install --immutable
- name: Build Dist 🔧
run: yarn run build
# Rollup's TS plugin can include an implicit dependency on tslib that we don't want. It shouldn't be
# included in builds if our tsconfig.json configures "target" properly, which this check ensures.
- name: Check for "tslib" in build
run: |
if grep -r '--include=*.'{cjs,js} 'tslib' ./lib -q
then
echo "tslib found in lib"
exit 1
fi
storybook:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- name: Install dependencies
run: yarn install --immutable
- name: Build design tokens
run: yarn build:tokens
- name: Build Storybook 📚
run: yarn build:storybook --webpack-stats-json
- name: Publish to Chromatic 🦄
run: |
yarn run chromatic \
--project-token=${{ secrets.CHROMATIC_PROJECT_TOKEN }} \
--storybook-build-dir storybook-static \
--exit-zero-on-changes \
--exit-once-uploaded \
--auto-accept-changes '{main,next}' \
--only-changed \
--skip 'dependabot/**'
- name: Run Accessibility Tests 💛
run: yarn run storybook:axeOnly
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup node 😻
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'yarn'
- name: Install Dependencies 🧶
run: yarn install --immutable
# required since there are references to built tokens
- name: Build design tokens 🛠️
run: yarn build:tokens
- name: Lint Commit Messages 👕
uses: wagoid/commitlint-github-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Lint Javascript + SCSS 👕
run: yarn run lint --max-warnings=0