-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (66 loc) · 2.03 KB
/
Copy pathci.yml
File metadata and controls
70 lines (66 loc) · 2.03 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun x ultracite check
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- runtime: bun
- runtime: node
node-version: "20"
- runtime: node
node-version: "22"
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- if: matrix.runtime == 'node'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: bun install --frozen-lockfile
- if: matrix.runtime == 'bun'
run: bun run test
- if: matrix.runtime == 'node'
run: node ./node_modules/vitest/vitest.mjs run
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run build
- name: Verify build artifacts
run: |
test -f dist/index.js || (echo "dist/index.js missing" && exit 1)
test -f dist/index.d.ts || (echo "dist/index.d.ts missing" && exit 1)
# PHOTON_OTEL_VERSION is inlined from package.json at build time. Assert on
# the built artifact, because that is what the release pipeline publishes
# after the bot bumps package.json.
- name: Verify dist reports the package version
run: |
bun -e '
const { PHOTON_OTEL_VERSION } = await import("./dist/index.js");
const { version } = await import("./package.json");
if (PHOTON_OTEL_VERSION !== version) {
throw new Error(`dist reports ${PHOTON_OTEL_VERSION}, package.json says ${version}`);
}
'