-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (44 loc) · 1.21 KB
/
Copy pathci.yml
File metadata and controls
48 lines (44 loc) · 1.21 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node: ["20", "22"]
steps:
- uses: actions/checkout@v5
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node }}
- name: Syntax check
run: node --check index.js
- name: Run tests
run: node --test
bun:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2
- name: Load plugin under Bun
run: |
cat > /tmp/plugin-load-check.mjs <<'EOF'
const mod = await import(process.cwd() + "/index.js");
if (typeof mod.CommandCode !== "function") {
throw new Error("CommandCode export is not a function");
}
if (typeof mod.default !== "function") {
throw new Error("default export is not a function");
}
console.log("bun: plugin loaded, exports are callable");
EOF
bun /tmp/plugin-load-check.mjs