mirror of
https://github.com/lucaspalomodevelop/eventcally.git
synced 2026-03-13 08:09:37 +00:00
60 lines
1.6 KiB
YAML
60 lines
1.6 KiB
YAML
# This is a basic workflow to help you get started with Actions
|
|
|
|
name: Tests
|
|
|
|
# Controls when the action will run.
|
|
on: [push, pull_request, workflow_dispatch]
|
|
|
|
jobs:
|
|
# Label of the container job
|
|
runner-job:
|
|
# Containers must run in Linux based operating systems
|
|
runs-on: ubuntu-latest
|
|
|
|
# Service containers to run with `container-job`
|
|
services:
|
|
# Label used to access the service container
|
|
postgres:
|
|
# Docker Hub image
|
|
image: mdillon/postgis
|
|
# 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
|
|
ports:
|
|
# Maps tcp port 5432 on service container to the host
|
|
- 5432:5432
|
|
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: '3.8'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Run tests
|
|
run: pytest --cov=project
|
|
env:
|
|
TEST_DATABASE_URL: postgresql://postgres:postgres@localhost/gsevpt_tests
|
|
|
|
- name: Codecov
|
|
if: ${{ success() }}
|
|
uses: codecov/codecov-action@v1
|
|
with:
|
|
verbose: true
|
|
fail_ci_if_error: true
|