Skip to content

test: add type checks for hero ID to ensure it is a string #73

test: add type checks for hero ID to ensure it is a string

test: add type checks for hero ID to ensure it is a string #73

Workflow file for this run

name: CI
on:
push:
branches:
- "main"
paths:
- "src/**"
- "tests/**"
- ".github/workflows/**"
- "pyproject.toml"
- "uv.lock"
- "!.gitignore"
- "!README.md"
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- "src/**"
- "tests/**"
- ".github/workflows/**"
- "pyproject.toml"
- "uv.lock"
- "!.gitignore"
- "!README.md"
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: public.ecr.aws/docker/library/postgres:17
env:
POSTGRES_USER: develop
POSTGRES_PASSWORD: develop_secret
POSTGRES_DB: develop
ports:
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Get python version
id: python-version
run: echo "python-version=$(cat version/python-version)" >> "$GITHUB_OUTPUT"
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ steps.python-version.outputs.python-version }}
- name: Get uv version
id: uv-version
run: echo "uv-version=$(cat version/uv)" >> "$GITHUB_OUTPUT"
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: ${{ steps.uv-version.outputs.uv-version }}
enable-cache: true
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Run tests (SQLite)
env:
API_KEY: TEST
run: |
uv run pytest -s --durations=5 --log-cli-level=INFO --capture=tee-sys -v
- name: Run tests (Postgres)
env:
API_KEY: TEST
run: |
uv run pytest -s --db postgres --durations=5 --log-cli-level=INFO --capture=tee-sys -v