-
Notifications
You must be signed in to change notification settings - Fork 37
141 lines (121 loc) · 3.64 KB
/
verify.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Run linting, unit tests, check build is possible.
# Standard requirements that should always be green.
# Tested on NodeJS LTS and current stable.
name: Verify
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
unit-tests:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: ['16', '18']
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --immutable --immutable-cache
env:
CYPRESS_INSTALL_BINARY: '0'
- name: Check commit message
if: ${{ github.event_name == 'pull_request' }}
run: yarn commitlint ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
- name: Linting & Unit testing
run: |
yarn build:libs
git diff --exit-code
yarn lint
yarn test
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: build
path: |
packages/core/build
packages/formik/build
packages/icons/build
ui-tests:
needs: unit-tests
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
browser: ['chrome']
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
with:
name: build
path: packages/
- name: Run Cypress UI tests
run: |
yarn install --immutable --immutable-cache
yarn cypress:ui-tests &
yarn cypress:chrome
- name: Upload screenshots for failed UI tests
uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-screenshots
path: packages/ui-tests/cypress/screenshots
docs:
needs: unit-tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
- name: Install dependencies
run: yarn install --immutable --immutable-cache
env:
CYPRESS_INSTALL_BINARY: '0'
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
with:
name: build
path: packages/
- name: Linting & Unit testing
run: |
yarn build:docs --env base="/practical-react-components/" --env prod="true"
git diff --exit-code
tar zcvf docs-static.tgz -C packages/docs dist
- name: Archive docs files
uses: actions/upload-artifact@v2
with:
name: docs-static
path: docs-static.tgz
deploy-docs:
needs: [docs, ui-tests]
runs-on: ubuntu-20.04
steps:
- name: Download docs files
uses: actions/download-artifact@v2
with:
name: docs-static
- name: Extract docs files
if: ${{ github.event_name != 'pull_request' }}
run: |
tar zxvf docs-static.tgz
- name: Deploy docs 🚀
if: ${{ github.event_name != 'pull_request' }}
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: docs # The branch the action should deploy to.
FOLDER: dist # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch