End-to-End Tests #52
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: End-to-End Tests | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: ["Build Images"] | |
types: | |
- completed | |
env: | |
POSTGRES_HOST: localhost | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: ctk | |
POSTGRES_PORT: 5432 | |
POSTGRES_SSL: false | |
DEVELOPMENT_USER: [email protected] | |
AZURE_FUNCTION_PYTHON_URL: http://localhost:8000 | |
jobs: | |
e2e: | |
runs-on: ubuntu-latest | |
services: | |
api: | |
image: cliniciantoolkit.azurecr.io/ctk-functions:latest | |
credentials: | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASSWORD }} | |
ports: | |
- 8000:8000 | |
env: | |
CLOAI_SERVICE_URL: http://cloai-service:8001/v1 | |
CLOAI_MODEL: sonnet-3.5-v2 | |
LANGUAGE_TOOL_URL: http://languagetool:8010/v2 | |
REDCAP_API_TOKEN: unused | |
cloai-service: | |
image: cliniciantoolkit.azurecr.io/cloai-service:latest | |
credentials: | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASSWORD }} | |
ports: | |
- 8001:8001 | |
env: | |
PORT: 8001 | |
CONFIG_JSON: | | |
{ | |
"clients": { | |
"sonnet-3.5-v2": { | |
"type": "bedrock-anthropic", | |
"model": "anthropic.claude-3-5-sonnet-20241022-v2:0", | |
"aws_access_key": ${{ secrets.AWS_ACCESS_KEY_ID }}, | |
"aws_secret_key": ${{ secrets.AWS_SECRET_ACCESS_KEY }}, | |
"region": "us-west-2" | |
} | |
} | |
} | |
languagetool: | |
image: erikvl87/languagetool:6.5 | |
ports: | |
- 8010:8010 | |
postgres: | |
image: postgres:latest | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_USER: ${{ env.POSTGRES_USER }} | |
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | |
POSTGRES_DB: ${{ env.POSTGRES_DB }} | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
steps: | |
- name: Checkout Frontend | |
uses: actions/checkout@main | |
with: | |
repository: childmindresearch/ctk-webapp | |
- name: Initialize PostgreSQL | |
env: | |
PGPASSWORD: ${{ env.POSTGRES_PASSWORD }} | |
run: psql -h localhost -U ${POSTGRES_USER} -d ctk -f ./e2e/init.sql | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.4.x | |
cache: npm | |
cache-dependency-path: package-lock.json | |
- name: Install dependencies | |
run: | | |
npm install --legacy-peer-deps | |
npx playwright install chromium | |
- name: Run tests | |
run: | | |
npm run test:integration | |
- name: Upload test artifacts | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: video-files | |
path: test-results/**/*.webm | |