Initial github workflows #2
This file contains hidden or 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
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| backend-tests: | |
| name: Backend Tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./backend | |
| services: | |
| postgres: | |
| image: postgres | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_USER: pguser | |
| POSTGRES_PASSWORD: pgpassword | |
| POSTGRES_DB: postgres | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| PG_HOST: localhost | |
| PG_USER: pguser | |
| PG_PASSWORD: pgpassword | |
| PG_DB: postgres | |
| POSTGRES_USER: pguser | |
| POSTGRES_PASSWORD: pgpassword | |
| POSTGRES_DB: postgres | |
| LLM_EVAL_ENCRYPTION_KEY: M2kbagZtWPjxfjeDio2VDH+sVH45BsUHUxHzR+hW3Ps= | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up poetry | |
| run: pipx install poetry==2.1.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'poetry' | |
| cache-dependency-path: ./backend/poetry.lock | |
| - name: Install dependencies | |
| run: poetry install --only=main,dev,test | |
| - name: Running tests | |
| run: poetry run pytest --cov llm_eval tests | |
| frontend-tests: | |
| name: Frontend Tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./frontend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.14' | |
| cache: 'npm' | |
| cache-dependency-path: './frontend/package-lock.json' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm run test:coverage |