-
Notifications
You must be signed in to change notification settings - Fork 2.1k
122 lines (110 loc) · 3.58 KB
/
Copy pathweb-checks.yml
File metadata and controls
122 lines (110 loc) · 3.58 KB
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
name: Web Checks
on:
push:
branches: main
pull_request:
branches: main
concurrency:
group: web-checks-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
has_admin: ${{ steps.changes.outputs.has_admin }}
has_frontend: ${{ steps.changes.outputs.has_frontend }}
has_personas: ${{ steps.changes.outputs.has_personas }}
has_web_app: ${{ steps.changes.outputs.has_web_app }}
has_web_build: ${{ steps.changes.outputs.has_web_build }}
has_web_lint: ${{ steps.changes.outputs.has_web_lint }}
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Detect changed paths
id: changes
uses: ./.github/actions/detect-changes
frontend-lint:
name: Frontend Lint
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.has_web_lint == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: |
web/frontend/package-lock.json
web/personas-open-source/package-lock.json
- name: Lint Frontend
if: needs.changes.outputs.has_frontend == 'true'
working-directory: ./web/frontend
run: |
npm ci
npm run lint
npm run lint:format -- --check
- name: Lint Personas
if: needs.changes.outputs.has_personas == 'true'
working-directory: ./web/personas-open-source
run: |
npm ci --legacy-peer-deps
npm run lint
build:
name: Build
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.has_web_build == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: |
web/app/package-lock.json
web/admin/package-lock.json
- name: Build Web App
if: needs.changes.outputs.has_web_app == 'true'
working-directory: ./web/app
env:
NEXT_PUBLIC_FIREBASE_API_KEY: dummy
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: dummy.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID: dummy
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: dummy.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: "123456789"
NEXT_PUBLIC_FIREBASE_APP_ID: "1:123456789:web:dummy"
NEXT_PUBLIC_FIREBASE_VAPID_KEY: dummy
run: |
npm ci
npm run build
- name: Build Admin Dashboard
if: needs.changes.outputs.has_admin == 'true'
working-directory: ./web/admin
env:
NEXT_PUBLIC_FIREBASE_API_KEY: dummy
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: dummy.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID: dummy
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: dummy.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: "123456789"
NEXT_PUBLIC_FIREBASE_APP_ID: "1:123456789:web:dummy"
NEXT_PUBLIC_FIREBASE_VAPID_KEY: dummy
NEXT_PUBLIC_PLUGINS_APP_ID: dummy
NEXT_PUBLIC_OMI_API_URL: https://api.omiapi.com
run: |
npm ci
npm run lint
npm run typecheck
npm test
npm run build