-
Notifications
You must be signed in to change notification settings - Fork 9
77 lines (73 loc) · 2.14 KB
/
build.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
name: Build
on:
pull_request:
types: [assigned, opened, synchronize, reopened]
paths-ignore:
- 'README.md'
- 'CONTRIBUTING.md'
- 'CHANGELOG.md'
- 'LICENSE'
push:
branches:
- master
jobs:
install:
runs-on: ubuntu-latest
steps:
# Checkout the Repo
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
# Setup Node 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
# Restore node_modules if cache exists. If not, cache is created at end of build.
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('**/yarn.lock') }}
# Run 'yarn' if cache doesn't exist. Use --prefer-offline to download packages from yarn cache folder where possible
- name: Install Dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn --prefer-offline --ignore-scripts
build:
needs: install
runs-on: ubuntu-latest
steps:
# Checkout the Repo
- name: Checkout
uses: actions/checkout@v3
# Setup Node 16
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
# Restore node_modules - Cache should exist as one was created in previous 'install' job
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('**/yarn.lock') }}
# Lint Styles
- name: Lint Styles
run: yarn lint:style
# Lint JS
- name: Lint JavaScript
run: yarn lint:scripts
# Check Build of CSS files
- name: Build Package CSS (to check it compiles correctly)
run: yarn build:css
# Run Unit Tests
- name: Unit Tests
run: yarn test
# Run DangerJS
- name: PR Checks (Dangerfile)
run: yarn danger ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}