-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (75 loc) · 2 KB
/
ci.yml
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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run lint
run: bun run lint
- name: Run tests
run: bun run test
integration:
runs-on: ubuntu-latest
services:
anki:
image: ghcr.io/yukaii/gakuon-headless-anki:latest
ports:
- 8765:8765
options: >-
--health-cmd "curl http://localhost:8765"
--health-interval 30s
--health-timeout 15s
--health-retries 3
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run integration tests
run: |
mkdir -p ~/.gakuon
cat <<'EOF' > ~/.gakuon/config.toml
# Gakuon Configuration File
# Generated on 2025-02-01T00:00:00.000Z
# Do not edit while Anki is running
[global]
ankiHost = "http://localhost:8765"
openaiApiKey = "${OPENAI_API_KEY}"
ttsVoice = "alloy"
[global.openai]
baseUrl = "https://api.openai.com/v1"
chatModel = "gpt-4o"
initModel = "gpt-4o"
ttsModel = "tts-1"
[global.cardOrder]
queueOrder = "learning_review_new"
reviewOrder = "due_date_random"
newCardOrder = "deck"
decks = []
EOF
bun run test:integration
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Build CLI
run: bun run build
- name: Build client
run: bun run build:client