forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (124 loc) · 4.18 KB
/
Copy pathweb-checks.yml
File metadata and controls
137 lines (124 loc) · 4.18 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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
timeout-minutes: 15
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:
# detect-changes diffs against the merge base, so it needs history;
# blob:none skips file contents, which is what made the unfiltered
# clone of this ~1.25GB repo take minutes.
fetch-depth: 0
filter: blob:none
- 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'
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
# Lint/test only reads the worktree; no git history is consulted.
fetch-depth: 1
- 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
npm test
build:
name: Build
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.has_web_build == 'true'
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
# Builds only read the worktree; no git history is consulted.
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: |
web/admin/package-lock.json
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- name: Build Web App
if: needs.changes.outputs.has_web_app == 'true'
working-directory: ./web/app
env:
NEXT_PUBLIC_API_BASE_URL: https://api.omi.me
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: |
bun install --frozen-lockfile
bun 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