2023-07-10 16:22:17 +03:00
|
|
|
name: Backend Tests
|
2023-07-02 03:19:30 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
2023-07-02 15:37:15 +03:00
|
|
|
paths:
|
2023-07-17 09:57:27 +03:00
|
|
|
- 'backend/core/**'
|
2023-07-02 03:19:30 +03:00
|
|
|
pull_request:
|
2023-07-02 15:37:15 +03:00
|
|
|
branches: [ main ]
|
|
|
|
paths:
|
2023-07-17 09:57:27 +03:00
|
|
|
- 'backend/core/**'
|
2023-07-02 03:19:30 +03:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
defaults:
|
|
|
|
run:
|
2023-07-17 09:57:27 +03:00
|
|
|
working-directory: ./backend/core
|
2023-07-02 03:19:30 +03:00
|
|
|
environment: preview
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python-version: [ "3.11"]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
cache: 'pip'
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install pytest
|
2023-07-10 16:22:17 +03:00
|
|
|
pip install pyright
|
2023-07-02 03:19:30 +03:00
|
|
|
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
|
|
|
- name: Test with pytest
|
|
|
|
env:
|
2023-07-06 11:09:21 +03:00
|
|
|
SUPABASE_URL: ${{secrets.SUPABASE_URL}}
|
|
|
|
SUPABASE_SERVICE_KEY: ${{secrets.SUPABASE_SERVICE_KEY}}
|
|
|
|
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}}
|
|
|
|
ANTHROPIC_API_KEY: ${{secrets.ANTHROPIC_API_KEY}}
|
|
|
|
JWT_SECRET_KEY: ${{secrets.JWT_SECRET_KEY}}
|
|
|
|
CI_TEST_API_KEY: ${{secrets.CI_TEST_API_KEY}}
|
2023-07-02 03:19:30 +03:00
|
|
|
run: |
|
2023-07-14 22:02:26 +03:00
|
|
|
python -m pytest tests/
|
2023-07-10 16:22:17 +03:00
|
|
|
|
|
|
|
- name: Static type checking with pyright
|
|
|
|
run: |
|
|
|
|
pyright
|