From 0224e0be682ebb274a21d6dff8a4a8d63c75216d Mon Sep 17 00:00:00 2001 From: Daniel Grams Date: Tue, 26 Jan 2021 14:25:21 +0100 Subject: [PATCH] Create test.yml --- .github/workflows/test.yml | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..9d9293b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +# 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