test: api server integration tests #147
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: bun install | |
- name: Create .gakuon directory | |
run: mkdir -p ~/.gakuon | |
- name: Create default config file | |
uses: finnp/[email protected] | |
env: | |
FILE_NAME: "~/.gakuon/config.toml" | |
FILE_DATA: | | |
# Gakuon Configuration File | |
# Generated on 2025-02-01T00:00:00.000Z | |
# Do not edit while Anki is running | |
[global] | |
ankiHost = "http://anki: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 = [] | |
- uses: hoverkraft-tech/[email protected] | |
with: | |
compose-file: "deployment/compose/docker-compose.simple.yml" | |
up-flags: "-d" | |
- name: Setup upterm session | |
uses: lhotari/action-upterm@v1 | |
- name: Run integration tests | |
run: 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 |