Skip to content

Commit

Permalink
Distinct workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
why-not-try-calmer committed Apr 3, 2023
1 parent 73d014a commit bfce844
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/test-conformance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test-conformance:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1

steps:

- uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Django image
uses: docker/build-push-action@v2
with:
context: .
file: docker/django/Dockerfile
push: true
pull: true
cache-from: type=registry,ref=opengisch/signalo-django:latest
cache-to: type=registry,ref=opengisch/signalo-django:latest,mode=max
tags: opengisch/signalo-django:latest

- name: Setup Compose appplication
run: |
# copy default conf
cp .env.example .env
# start the stack
docker compose up --build -d
sleep 10
# deploy static files and migrate database
docker compose run django python manage.py collectstatic --no-input
docker compose run django python manage.py migrate --no-input
# sprinkle some test data (refreshing computed fields is done from the command handler)
docker compose run django python manage.py init --data
- name: Healthcheck
run: wget --no-check-certificate https://localhost/oapif/collections/poles/items

- uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install and run conformance test
run: |
# Wrapper around official test suite for more convenient handling in CI
git clone https://github.com/pblottiere/pyogctest
cd pyogctest
pip install -e .
./pyogctest.py -s wms130 -u http://localhost:8000/oapif/
- name: Failure logs
if: failure()
run: docker-compose logs

0 comments on commit bfce844

Please sign in to comment.