mirror of
https://github.com/lucaspalomodevelop/eventcally.git
synced 2026-03-13 00:07:22 +00:00
50 lines
1.4 KiB
YAML
50 lines
1.4 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_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: gsevpt_tests
|
|
# 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: Install postgis
|
|
run: psql -c 'create extension postgis;' -h postgres -U postgres -d gsevpt_tests
|
|
env:
|
|
PGPASSWORD: postgres
|
|
|
|
- name: Run tests
|
|
run: pytest --cov-report=html --cov=project tests/test___init__.py
|
|
env:
|
|
TEST_DATABASE_URL: postgresql://postgres:postgres@postgres/gsevpt_tests
|