-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73d014a
commit bfce844
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |