2021-01-26 14:25:21 +01:00

44 lines
1.1 KiB
YAML

# This is a basic workflow to help you get started with Actions
name: Tests
# Controls when the action will run.
on: [workflow_dispatch]
jobs:
# Label of the container job
container-job:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container: python:3.7-slim-buster
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests
run: pytest --cov=project
env:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432