Skip to content

Sever: Add Sentry

Sever: Add Sentry #19

Workflow file for this run

name: Server CI
on:
pull_request:
paths:
- "server/**"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Load secrets from 1Password
uses: 1password/load-secrets-action@v1
with:
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
PQL_API_KEY: "op://Product ACT/pql-docs-bot/pql-api-key"
JWT_SECRET: "op://Product ACT/pql-docs-bot/jwt-secret"
SENTRY_DSN: "op://Product ACT/pql-docs-bot/sentry-dsn"
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: |
cd server
bun install
- name: Run tests
run: |
cd server
bun test
docker-integration:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Load secrets from 1Password
uses: 1password/load-secrets-action@v1
with:
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
PQL_API_KEY: "op://Product ACT/pql-docs-bot/pql-api-key"
JWT_SECRET: "op://Product ACT/pql-docs-bot/jwt-secret"
SENTRY_DSN: "op://Product ACT/pql-docs-bot/sentry-dsn"
- name: Build Docker image
run: |
cd server
docker build -t docs-bot-server:test .
- name: Test Docker container
run: |
cd server
docker run -d --name test-server \
-p 4000:4000 \
-e SERVER_PORT=4000 \
-e PQL_API_KEY="${PQL_API_KEY}" \
-e JWT_SECRET="${JWT_SECRET}" \
-e SENTRY_DSN="${SENTRY_DSN}" \
docs-bot-server:test
sleep 10
curl -f http://localhost:4000/ || exit 1
curl -X POST http://localhost:4000/chat/conversations/test/messages \
-H "Content-Type: application/json" \
-d '{"message":"test","history":[]}' \
--max-time 30 || exit 1
docker stop test-server