-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (68 loc) · 2.4 KB
/
Copy pathci.yml
File metadata and controls
81 lines (68 loc) · 2.4 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-test:
runs-on: ubuntu-latest
# One lane per shipped tier (production .min.js) plus the full development
# build, so every published bundle runs the suite, not just full-dev. The
# list-free tiers (nano, mini-pool) use their own config, which excludes
# every data-list test file.
strategy:
fail-fast: false
matrix:
dist: [full-dev, full, spa, core, lite, mini]
script: [test]
include:
- { dist: mini-pool, script: 'test:nano' }
- { dist: nano, script: 'test:nano' }
name: test (${{ matrix.dist }})
steps:
- uses: actions/checkout@v5
- name: Use Node.js 22
uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Cache Playwright browsers
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Build
run: npm run build
- name: Run tests (${{ matrix.dist }})
run: npx cross-env WILDFLOWER_DIST=${{ matrix.dist }} npm run ${{ matrix.script }}
bundle-size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run build
- name: Report bundle sizes
run: |
echo "## Bundle Sizes" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Variant | Raw | Gzip | Brotli |" >> $GITHUB_STEP_SUMMARY
echo "|---------|-----|------|--------|" >> $GITHUB_STEP_SUMMARY
for f in dist/*.min.js; do
name=$(basename "$f")
raw=$(wc -c < "$f" | awk '{printf "%.1f KB", $1/1024}')
gz=$(gzip -c "$f" | wc -c | awk '{printf "%.1f KB", $1/1024}')
br=""
if [ -f "$f.br" ]; then
br=$(wc -c < "$f.br" | awk '{printf "%.1f KB", $1/1024}')
fi
echo "| $name | $raw | $gz | $br |" >> $GITHUB_STEP_SUMMARY
done