-
Notifications
You must be signed in to change notification settings - Fork 29
144 lines (106 loc) · 3.04 KB
/
ci.yaml
File metadata and controls
144 lines (106 loc) · 3.04 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
138
139
140
141
142
143
144
name: Check format, build, and run tests
on: [push, pull_request]
jobs:
format:
name: Check format
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install
run: npm install
- name: Check format
run: |
npx prettier --check "**/*.ts"
npx eslint --quiet "**/*.ts"
test:
name: Build backend and run tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Set up Java 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Install firebase
run: |
npm install -g firebase-tools
- name: Install dependencies
run: npm install
- name: Build utils
run: npm run build --workspace=utils
- name: Build functions
run: npm run build --workspace=functions
- name: Test utils
run: npm test --workspace=utils
- name: Test functions
run: npm test --workspace=functions
build_frontend:
name: Build frontend and run tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build utils
run: npm run build --workspace=utils
- name: Build frontend
run: |
cp frontend/index.example.html frontend/index.html
cp frontend/firebase_config.example.ts frontend/firebase_config.ts
npm run build --workspace=frontend
- name: Test frontend
run: npm test --workspace=frontend
schemas:
name: Check generated schemas are up to date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install dependencies
run: |
npm install
cd scripts && uv sync
- name: Regenerate schemas
run: npm run update-schemas
- name: Check for diff
run: |
if ! git diff --exit-code docs/assets/api/schemas.json scripts/deliberate_lab/types.py; then
echo ""
echo "Generated schemas are out of date. Please run 'npm run update-schemas' and commit the changes."
exit 1
fi