Skip to content

test ci

test ci #6

Workflow file for this run

name: CI
on:
push:
branches:
- main
- actions
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
services:
pg:
image: postgres:17-bookworm
ports:
- 5432:5432
env:
POSTGRES_USER: ${{ vars.FAPI_POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ vars.FAPI_POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ vars.FAPI_POSTGRES_DB }}
options: >-
--health-cmd="pg_isready -U ${{ vars.FAPI_POSTGRES_USER }} -d ${{ vars.FAPI_POSTGRES_DB }}"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python 3.13.1
uses: actions/setup-python@v4
with:
python-version: 3.13.1
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "${HOME}/.local/bin" >> $GITHUB_PATH
- name: Export requirements.txt
working-directory: back
run: poetry export -f requirements.txt --output requirements.txt --without-hashes
- name: Install dependencies from requirements.txt
working-directory: back
run: |
python -m pip install --no-cache-dir --upgrade pip
pip install --no-cache-dir --upgrade -r requirements.txt
- name: Run tests
working-directory: back
run: pytest