-
Notifications
You must be signed in to change notification settings - Fork 8
101 lines (88 loc) · 2.69 KB
/
ci-dapps.yaml
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
# Checks the frontend apps for build, lint, and formatting errors
name: Check
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main, release**, feature** ]
pull_request:
branches: [ main, release**, feature** ]
# Don't run on draft PR's, see: https://github.com/orgs/community/discussions/25722#discussioncomment-3248917
types: [ opened, synchronize, reopened, ready_for_review ]
paths:
- front-end-tools/**/*
# Allows us to run the workflow manually from the Actions tab
workflow_dispatch:
env:
DUMMY: 0 # For cache busting.
NODE_VERSION: 18.16.0
jobs:
deps:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./front-end-tools
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache-dependency-path: "./front-end-tools/yarn.lock"
- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: |
./front-end-tools/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('./front-end-tools/yarn.lock') }}-${{ env.DUMMY }}
restore-keys: |
${{ runner.os }}-yarn
- name: Get dependencies
run: yarn install --immutable
lint:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
needs: deps
defaults:
run:
working-directory: ./front-end-tools
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache-dependency-path: "./front-end-tools/yarn.lock"
- name: Restore dependencies
uses: actions/cache/restore@v3
with:
path: |
./front-end-tools/node_modules
key: ${{ runner.os }}-yarn
- name: Lint
run: yarn lint && yarn fmt-check
build:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
needs: deps
defaults:
run:
working-directory: ./front-end-tools
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache-dependency-path: "./front-end-tools/yarn.lock"
- name: Restore dependencies
uses: actions/cache/restore@v3
with:
path: |
./front-end-tools/node_modules
key: ${{ runner.os }}-yarn
- name: Build
run: yarn build