Skip to content

Merge pull request #191 from praekeltfoundation/research_consent_bug #693

Merge pull request #191 from praekeltfoundation/research_consent_bug

Merge pull request #191 from praekeltfoundation/research_consent_bug #693

Workflow file for this run

name: QA Docker Image
on:
push:
branches:
- develop
pull_request:
branches:
- develop
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:11-2.5-alpine
env:
POSTGRES_DB: healthcheck
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
redis:
image: redis:alpine
ports:
- 6379:6379
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7.15
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y gdal-bin
python -m pip install --upgrade pip
pip install -e .
pip install -r requirements-dev.txt
- name: Run tests
run: |
DJANGO_SETTINGS_MODULE=healthcheck.settings.test python manage.py makemigrations --dry-run | grep 'No changes detected' || (echo 'There are changes which require migrations.' && exit 1)
flake8 ./healthcheck
black --check .
python manage.py test
build:
if: github.event_name == 'push'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
- name: construct image metadata
id: meta
uses: crazy-max/ghaction-docker-meta@v2
with:
images: |
ghcr.io/${{ github.repository }}
praekeltfoundation/healthcheck-django
tags: |
type=sha
- name: login to ghcr
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: login to docker hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}