forked from cloudflare/cloudflare-os
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (73 loc) · 3.01 KB
/
Copy pathci.yml
File metadata and controls
86 lines (73 loc) · 3.01 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
name: CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
env:
NODE_VERSION: "24.19.0"
jobs:
# Parallel to `test` so lint and test failures surface on the same run. Package type checking
# lives in Build; `scripts/` is checked here instead, because it is deliberately kept off
# `pnpm build`'s hot path (see AGENTS.md) and this is the cheap job.
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Vite+ downloads its own pnpm for `vp install` and exposes no shim, so this is what puts
# `pnpm` on PATH for the steps below.
- name: Enable Corepack
run: corepack enable
# Vite+ resolves its own version from the `vite-plus` catalog entry, and installs the pnpm
# named in `packageManager` (integrity hash checked as Corepack does), so setup-node is not
# needed.
#
# No `cache` here, unlike `test`: this job is fast anyway, and both caching
# means they race to reserve the same lockfile-keyed entry.
# TODO(someday): It would be great if the setup-vp action could share a cache key with the test job but disable writes to cache
- name: Set up Vite+, Node.js and dependencies
uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: false
run-install: true
- name: Lint
run: pnpm lint:check
- name: Type-check scripts/
run: pnpm types:scripts
test:
name: Build and test
runs-on: ubuntu-latest
# Install, build and test together take ~2.5 minutes. Without an explicit cap a wedged test
# process (a spawned child that outlives its reap keeps `node --test` alive forever) burns the
# 6-hour default instead of failing, on every run of the branch.
timeout-minutes: 20
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Vite+ downloads its own pnpm for `vp install` and exposes no shim, so this is what puts
# `pnpm` on PATH for the steps below.
- name: Enable Corepack
run: corepack enable
# Vite+ resolves its own version from the `vite-plus` catalog entry, and installs the pnpm
# named in `packageManager` (integrity hash checked as Corepack does), so setup-node is not
# needed.
- name: Set up Vite+, Node.js and dependencies
uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: true
run-install: true
# Codegen, the frontend/SPA bundles, and the repo's single type check (`types:check` aliases this).
- name: Build
run: pnpm build
- name: Test
run: pnpm test