mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
Close [AI-59](https://linear.app/affine-design/issue/AI-59) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for two new providers, Anthropic and Exa, in test environments and configurations. - **Chores** - Updated workflow and test environment setup to include API keys for Anthropic and Exa providers. - **Refactor** - Changed the AI model used for the "Chat With AFFiNE AI" prompt to "claude-3-7-sonnet-20250219". <!-- end of auto-generated comment: release notes by coderabbit.ai -->
34 lines
1.2 KiB
YAML
34 lines
1.2 KiB
YAML
name: 'Prepare Server Test Environment'
|
|
description: 'Prepare Server Test Environment'
|
|
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
- name: Initialize database
|
|
shell: bash
|
|
run: |
|
|
psql -h localhost -U postgres -c "CREATE DATABASE affine;"
|
|
psql -h localhost -U postgres -c "CREATE USER affine WITH PASSWORD 'affine';"
|
|
psql -h localhost -U postgres -c "ALTER USER affine WITH SUPERUSER;"
|
|
env:
|
|
PGPASSWORD: affine
|
|
|
|
- name: Run init-db script
|
|
shell: bash
|
|
env:
|
|
NODE_ENV: test
|
|
run: |
|
|
yarn affine @affine/server prisma generate
|
|
yarn affine @affine/server prisma migrate deploy
|
|
yarn affine @affine/server data-migration run
|
|
- name: Import config
|
|
shell: bash
|
|
run: |
|
|
printf '{"copilot":{"enabled":true,"providers.fal":{"apiKey":"%s"},"providers.gemini":{"apiKey":"%s"},"providers.openai":{"apiKey":"%s"},"providers.perplexity":{"apiKey":"%s"},"providers.anthropic":{"apiKey":"%s"},"exa":{"key":"%s"}}}' \
|
|
"$COPILOT_FAL_API_KEY" \
|
|
"$COPILOT_GOOGLE_API_KEY" \
|
|
"$COPILOT_OPENAI_API_KEY" \
|
|
"$COPILOT_PERPLEXITY_API_KEY" \
|
|
"$COPILOT_ANTHROPIC_API_KEY" \
|
|
"$COPILOT_EXA_API_KEY" > ./packages/backend/server/config.json
|