cp-pricing (#1314) #1
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: e2e tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
db-type-checks: | |
name: DB type checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: supabase/setup-cli@v1 | |
with: | |
version: latest | |
- run: supabase db start | |
- run: supabase db lint | |
- name: Generate types and check for changes | |
run: | | |
bash genSupabaseTypes.sh | |
if git status | grep "database.types.ts"; then | |
git diff --ignore-space-at-eol web/supabase/database.types.ts | |
echo "Detected uncommitted changes after build in web/supabase/database.types.ts. See status below:" | |
git diff | |
exit 1 | |
fi | |
helicone-node-tests: | |
name: Helicone Node Package tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run node tests | |
working-directory: helicone-node | |
run: | | |
npm install | |
npm test | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Lint worker | |
run: | | |
cd worker | |
yarn install | |
yarn lint | |
tests: | |
name: Python E2E tests | |
runs-on: ubuntu-latest | |
services: | |
clickhouse: | |
image: yandex/clickhouse-server | |
ports: | |
- 8123:8123 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: supabase/[email protected] | |
with: | |
version: latest | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: Cache npm packages | |
uses: actions/cache@v3 | |
with: | |
path: | | |
./worker/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('./worker/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install node dependencies | |
run: | | |
cd worker | |
npm install -g wrangler | |
npm install | |
- name: Start proxy worker | |
run: | | |
cd worker | |
wrangler dev --port 8787 --var WORKER_TYPE:OPENAI_PROXY & | |
env: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
- name: Start async worker | |
run: | | |
cd worker | |
wrangler dev --port 8788 --var WORKER_TYPE:HELICONE_API & | |
env: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
- name: Start gateway worker | |
run: | | |
cd worker | |
wrangler dev --port 8789 --var WORKER_TYPE:GATEWAY_API & | |
env: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
- name: Start Supabase DB & API | |
run: supabase start db,api | |
- name: Install python dependencies | |
run: | | |
pip install requests pytest psycopg2 python-dotenv helicone | |
- name: Run integration tests | |
working-directory: tests | |
env: | |
HELICONE_PROXY_URL: "http://127.0.0.1:8787/v1" | |
HELICONE_ASYNC_URL: "http://127.0.0.1:8788" | |
HELICONE_GATEWAY_URL: "http://127.0.0.1:8789" | |
SUPABASE_KEY: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU" | |
SUPABASE_URL: "http://localhost:54321" | |
HELICONE_API_KEY: "sk-helicone-aizk36y-5yue2my-qmy5tza-n7x3aqa" | |
OPENAI_API_KEY: ${{ secrets.CI_OPENAI_API_KEY }} | |
OPENAI_ORG: ${{ secrets.CI_OPENAI_ORG }} | |
run: | | |
pytest python_integration_tests.py -s | |
- name: Run helicone-python tests | |
working-directory: helicone-python | |
env: | |
HELICONE_PROXY_URL: "http://127.0.0.1:8787/v1" | |
HELICONE_ASYNC_URL: "http://127.0.0.1:8788" | |
HELICONE_GATEWAY_URL: "http://127.0.0.1:8789" | |
SUPABASE_KEY: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU" | |
SUPABASE_URL: "http://localhost:54321" | |
HELICONE_API_KEY: "sk-helicone-aizk36y-5yue2my-qmy5tza-n7x3aqa" | |
OPENAI_API_KEY: ${{ secrets.CI_OPENAI_API_KEY }} | |
OPENAI_ORG: ${{ secrets.CI_OPENAI_ORG }} | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
poetry install | |
poetry run pytest -s tests/test_async.py |