Repository navigation
88 lines (73 loc) · 2.44 KB
/
Copy pathci.yml
File metadata and controls
88 lines (73 loc) · 2.44 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
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
with:
bun-version: canary # bun fmt/lint need 1.4.6; switch back to bun-version-file once it is stable
- run: bun install --frozen-lockfile
- run: bun fmt --check
- run: bun lint
- run: bun run type-check
- run: bun test
- run: bun run build
# Check the tarball that would be published: exports, types and package.json fields.
- run: bun pm pack --destination ./pack
- run: bunx publint --strict
- run: bunx attw ./pack/*.tgz --profile esm-only
- uses: actions/upload-artifact@v7
with:
name: package
path: pack/*.tgz
# Installs the packed tarball like a user would and runs a smoke test on every supported runtime.
runtimes:
needs: check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { runtime: node, version: 20, run: node smoke.mjs }
- { runtime: node, version: 22, run: node smoke.mjs }
- { runtime: node, version: 24, run: node smoke.mjs }
- { runtime: bun, version: latest, run: bun smoke.mjs }
- { runtime: deno, version: v2.x, run: deno run --allow-read --allow-env smoke.mjs }
name: ${{ matrix.runtime }} ${{ matrix.version }}
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
name: package
path: pack
# npm is needed for the install step in every job, so Node is always set up.
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.runtime == 'node' && matrix.version || 24 }}
- if: matrix.runtime == 'bun'
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ matrix.version }}
- if: matrix.runtime == 'deno'
uses: denoland/setup-deno@v2
with:
deno-version: ${{ matrix.version }}
- name: Install the tarball into an empty project
run: |
mkdir smoke && cd smoke
npm init -y > /dev/null
npm pkg set type=module
npm install ../pack/*.tgz hono
cp ../test/smoke/smoke.mjs .
- working-directory: smoke
run: ${{ matrix.run }}