-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (92 loc) · 2.65 KB
/
ci.yml
File metadata and controls
95 lines (92 loc) · 2.65 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
89
90
91
92
93
94
95
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- uses: oven-sh/setup-bun@v2
name: Install Bun
- uses: actions/cache@v5
name: Setup Bun cache
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install dependencies
run: bun install
- name: Typecheck
run: bun run typecheck
- name: Run tests
run: bun run test
- name: Build dist
run: bun run build
- name: Verify dist is up-to-date
run: |
if [ -n "$(git status --porcelain dist/)" ]; then
echo "::error::dist/ is out of date. Run 'bun run build' and commit the result."
git diff dist/
exit 1
fi
- name: Upload dist for smoke test
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
if-no-files-found: error
smoke-test:
name: Smoke Test
runs-on: ubuntu-latest
needs:
- build
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
env:
CURSOR_SMOKE_TEST_MODEL: auto
permissions:
contents: read
actions: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download dist from build
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Prepare smoke workspace
run: mkdir -p /tmp/cursor-smoke
- name: Run cursor-action (smoke test)
id: cursor
uses: ./
with:
api-key: ${{ secrets.CURSOR_API_KEY }}
prompt: "Say 'smoke test passed' and nothing else."
cursor-version: "latest"
model: ${{ env.CURSOR_SMOKE_TEST_MODEL }}
working-directory: "/tmp/cursor-smoke"
permissions: "read-only"
timeout: "60"
- name: Assert output is non-empty
run: |
SUMMARY="${{ steps.cursor.outputs.summary }}"
if [ -z "$SUMMARY" ]; then
echo "::error::cursor-action returned an empty summary"
exit 1
fi
echo "Smoke test passed. Summary: $SUMMARY"