Repository navigation
70 lines (61 loc) · 1.71 KB
/
Copy pathci.yml
File metadata and controls
70 lines (61 loc) · 1.71 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]
schedule:
- cron: "15 5 * * 1"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install
run: bun install --frozen-lockfile
- name: Format check
run: bun run format:check
- name: Typecheck
run: bun run typecheck
- name: Unit tests
run: bun test
- name: Build + smoke
run: bun run build && bun run smoke
host-contract:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- package: opencode-ai
floor: 1.18.0
pinned: 1.19.6
major: 1
check: contract
- package: "@opencode/cli"
floor: 2.0.3
pinned: 2.4.1
major: 2
check: contract:v2
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile && bun run build
- name: Test supported floor and current host
env:
HOST_PACKAGE: ${{ matrix.package }}
HOST_FLOOR: ${{ matrix.floor }}
HOST_CURRENT: ${{ github.event_name == 'schedule' && matrix.major || matrix.pinned }}
CHECK: ${{ matrix.check }}
run: |
for version in "$HOST_FLOOR" "$HOST_CURRENT"; do
host="$RUNNER_TEMP/opencode-$version"
npm install --prefix "$host" --no-save "$HOST_PACKAGE@$version"
PATH="$host/node_modules/.bin:$PATH" bun run "$CHECK"
done