-
Notifications
You must be signed in to change notification settings - Fork 22
92 lines (88 loc) · 2.71 KB
/
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
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
name: CI
on:
push:
branches-ignore:
- main
jobs:
test_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: bahmutov/npm-install@v1
- name: If this step fails run 'yarn lint' and 'yarn format' then commit again.
run: |
yarn lint:check
yarn format:check
test:
runs-on: ${{ matrix.os }}
needs: test_lint
strategy:
matrix:
node: ['16', '20']
os: [ubuntu-latest]
name: Test with Node v${{ matrix.node }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: bahmutov/npm-install@v1
- name: Check Typing
run: yarn run check
- name: Unit Tests
run: yarn run test
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Build Storybook
run: yarn run build-storybook --quiet
- name: E2E Tests
run: npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" "npx http-server storybook-static --port 9999 --silent" "npx wait-on tcp:9999 && yarn run test:e2e"
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
build-storybook-beta:
needs: test
# We push storybook only in push on develop branch
if: |
github.event_name == 'push' && github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: bahmutov/npm-install@v1
- run: yarn
# Build Storybook
- run: yarn build-storybook
- run: mkdir -p deploy-beta/storybook-beta
- run: cp -R ./storybook-static/. ./deploy-beta/storybook-beta
# Add json to fetch for suggester stories
- run: cp -a ./public/. ./deploy-beta/storybook-beta
- name: Upload deploy artifact
uses: actions/upload-artifact@v3
with:
name: deploy-beta
path: deploy-beta/
deploy-storybook-beta:
runs-on: ubuntu-latest
needs: build-storybook-beta
steps:
- uses: actions/checkout@v3
with:
ref: gh-pages
- name: Download deploy artifact
uses: actions/download-artifact@v3
with:
name: deploy-beta
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
author_name: 'Github action'
message: 'Update Storybook beta (develop branch)'
branch: 'gh-pages'