Skip to content

testing

testing #48

Workflow file for this run

name: test
run-name: testing
on:
push:
branches: [main]
paths: ["src/**", "tests/**"]
pull_request:
types: [opened]
paths: ["src/**", "tests/**"]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 1234
POSTGRES_DB: amdb_test
ports: ["5432:5432"]
steps:
- name: checkout
uses: actions/checkout@v4
- name: install python3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: install dependencies
run: pipx install poetry && poetry install
- name: run test
run: poetry run pytest --cov=./ --cov-report=xml
env:
TEST_DATABASE_POSTGRES_USER: postgres
TEST_DATABASE_POSTGRES_PASSWORD: 1234
TEST_DATABASE_POSTGRES_HOST: 127.0.0.1
TEST_DATABASE_POSTGRES_PORT: 5432
TEST_DATABASE_POSTGRES_NAME: amdb_test
- name: upload coverage report to Codecov
uses: codecov/codecov-action@v3
env:
token: ${{ secrets.CODECOV_TOKEN }}