forked from anomalyco/models.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.24 KB
/
validate.yml
File metadata and controls
47 lines (38 loc) · 1.24 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
name: Validate
on:
pull_request:
branches: [dev]
jobs:
validate:
name: Validate Models & Schema
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Cache Bun dependencies
uses: actions/setup-node@v4
with:
cache: bun
cache-dependency-path: ./bun.lock
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Validate all provider/model TOML configurations
run: bun validate
- name: Run unit tests
run: |
# Run tests if test directories exist; skip gracefully if not
TEST_DIRS=""
[ -d packages/core/test ] && TEST_DIRS="$TEST_DIRS packages/core/test/"
[ -d packages/web/test ] && TEST_DIRS="$TEST_DIRS packages/web/test/"
[ -d packages/function/test ] && TEST_DIRS="$TEST_DIRS packages/function/test/"
if [ -n "$TEST_DIRS" ]; then
bun test $TEST_DIRS
else
echo "No test directories found, skipping tests"
fi
- name: Build web interface
run: cd packages/web && bun run build