[pre-commit.ci] pre-commit autoupdate #73
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: API Testing | |
on: [pull_request, push, workflow_dispatch] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:15 | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_PASSWORD: adminpw | |
POSTGRES_USER: admin | |
POSTGRES_DB: gamingrealmdb | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction | |
- name: Migrate tables and generate Prisma client | |
env: | |
GR_DATABASE_URL: postgres://admin:adminpw@localhost:5432/gamingrealmdb | |
run: | | |
poetry run prisma db push | |
- name: Run tests | |
env: | |
GR_DATABASE_URL: postgres://admin:adminpw@localhost:5432/gamingrealmdb | |
SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
SUPABASE_API_KEY: ${{ secrets.SUPABASE_API_KEY }} | |
SUPABASE_BUCKET_NAME: ${{ secrets.SUPABASE_BUCKET_NAME }} | |
run: | | |
poetry run pytest |