-
Notifications
You must be signed in to change notification settings - Fork 11
71 lines (62 loc) · 2.21 KB
/
validate.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
# PR's only
name: Validate
on:
pull_request:
branches: [master]
env:
FORCE_COLOR: 1
jobs:
lintAndFormatting:
name: Lint & Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Retrieve last master commit (for `git diff` purposes)
run: |
git checkout -b pr
git fetch --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master
git checkout master
git checkout pr
- name: Retrieve ~/.npm from cache
uses: actions/cache@v1
with:
path: ~/.npm
key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('**package*.json') }}
restore-keys: |
npm-v14-${{ runner.os }}-${{ github.ref }}-
npm-v14-${{ runner.os }}-refs/heads/master-
- name: Retrieve node_modules from cache
id: cacheNodeModules
uses: actions/cache@v1
with:
path: node_modules
key: node-modules-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
restore-keys: |
node-modules-v14-${{ runner.os }}-${{ github.ref }}-
node-modules-v14-${{ runner.os }}-refs/heads/master-
- name: Retrieve src/node_modules from cache
id: cacheSrcNodeModules
uses: actions/cache@v1
with:
path: src/node_modules
key: src/node-modules-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('src/package*.json') }}
restore-keys: |
src/node-modules-v14-${{ runner.os }}-${{ github.ref }}-
src/node-modules-v14-${{ runner.os }}-refs/heads/master-
- name: Install Node.js and npm
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install root dependencies
if: steps.cacheNodeModules.outputs.cache-hit != 'true'
run: npm update --save-dev --no-save
- name: Install src dependencies
if: steps.cacheSrcNodeModules.outputs.cache-hit != 'true'
run: |
cd src
npm ci
- name: Validate Formatting
run: npm run prettier-check:updated
- name: Validate Lint rules
run: npm run lint:updated