-
Notifications
You must be signed in to change notification settings - Fork 77
56 lines (46 loc) · 1.27 KB
/
review.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
name: review
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize]
concurrency:
group: review-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
node: [16.x]
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3
- name: 🏗 Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
- name: 📦 Install dependencies
run: yarn install --frozen-lockfile --check-files
- name: ✅ Lint code
run: yarn lint --max-warnings=0
- name: 🧪 Test code
run: yarn test
- name: 👷 Build code
run: yarn clean && yarn build
- name: 🕵️ Validate build
id: diff
run: |
if [ "$(git diff --ignore-space-at-eol build/ | wc -l)" -gt "0" ]; then
echo "⚠️ Build is outdated"
echo " > run 'yarn clean', 'yarn build', and commit changes"
git diff
exit 1
fi
- name: 🗂 Upload build
uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: build
path: build/