Skip to content

Merge pull request #649 from linz/update_doc29 #1077

Merge pull request #649 from linz/update_doc29

Merge pull request #649 from linz/update_doc29 #1077

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
db:
name: Database tests [${{ matrix.db_image.name }} DB]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
db_image:
- {name: 'Legacy', image: 'ghcr.io/linz/nz-buildings-db-legacy:v1'}
- {name: 'Modern', image: 'ghcr.io/linz/nz-buildings-db-modern:v1'}
env:
PGHOST: localhost
PGPORT: 54320
PGUSER: buildings
PGPASSWORD: buildings
BASE_DIR: ${{ github.workspace }}
DB_DOCKER_IMAGE: ${{ matrix.db_image.image }}
DOCKER_NETWORK: buildings
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Create docker network
run: bash $BASE_DIR/scripts/steps/create_docker_network.sh
- name: Launch database container
run: bash $BASE_DIR/scripts/steps/launch_database_container.sh
- name: Print docker logs
uses: jwalton/gh-docker-logs@v1
- name: Load additional schemas
run: bash $BASE_DIR/scripts/steps/load_additional_schemas.sh
- name: Sqitch deploy and verify
run: bash $BASE_DIR/scripts/steps/sqitch_deploy_verify.sh
- name: Sqitch revert
run: bash $BASE_DIR/scripts/steps/sqitch_revert.sh
- name: Sqitch deploy
run: bash $BASE_DIR/scripts/steps/sqitch_deploy.sh
- name: Load test data
run: bash $BASE_DIR/scripts/steps/load_db_test_data.sh
- name: Run pgTAP tests
run: bash $BASE_DIR/scripts/steps/run_pgtap_tests.sh
qgis:
name: QGIS tests [QGIS ${{ matrix.qgis_image.name }}, ${{ matrix.db_image.name }} DB]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
db_image:
- {name: 'Legacy', image: 'ghcr.io/linz/nz-buildings-db-legacy:v1'}
- {name: 'Modern', image: 'ghcr.io/linz/nz-buildings-db-modern:v1'}
qgis_image:
- {name: '3.10', image: 'qgis/qgis:release-3_10'}
- {name: '3.16', image: 'qgis/qgis:release-3_16'}
- {name: '3.24', image: 'qgis/qgis:release-3_24'}
env:
PGHOST: localhost
PGPORT: 54320
PGUSER: buildings
PGPASSWORD: buildings
BASE_DIR: ${{ github.workspace }}
DB_DOCKER_IMAGE: ${{ matrix.db_image.image }}
QGIS_DOCKER_IMAGE: ${{ matrix.qgis_image.image }}
QGIS_DISPLAY: ":99"
DOCKER_NETWORK: buildings
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Create docker network
run: bash $BASE_DIR/scripts/steps/create_docker_network.sh
- name: Launch database container
run: bash $BASE_DIR/scripts/steps/launch_database_container.sh
- name: Print docker logs
uses: jwalton/gh-docker-logs@v1
- name: Load additional schemas
run: bash $BASE_DIR/scripts/steps/load_additional_schemas.sh
- name: Sqitch deploy
run: bash $BASE_DIR/scripts/steps/sqitch_deploy.sh
- name: Load test data
run: bash $BASE_DIR/scripts/steps/load_qgis_test_data.sh
- name: Launch QGIS container
run: bash $BASE_DIR/scripts/steps/launch_qgis_container.sh
- name: Setup QGIS plugin
run: bash $BASE_DIR/scripts/steps/setup_qgis_plugin.sh
- name: Run QGIS tests
run: bash $BASE_DIR/scripts/steps/run_qgis_tests.sh
docs:
name: Documentation
runs-on: ubuntu-latest
env:
BUILD: docs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Install required Python modules
run: |
grep sphinx requirements-dev.txt | xargs pip3 install
pip3 install -r requirements-docs.txt
- name: Run Sphinx build
run: |
sphinx-build -b html db/docs/source db/docs
deploy:
name: Deploy
if: contains(github.ref, 'refs/tags/')
needs: [db, qgis, docs]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2-beta
with:
ref: ${{ github.ref }}
- name: Build project # This would actually build your project, using zip for an example artifact
run: |
echo ${{ github.ref }}
echo ${{ github.repository }}
zip -r buildings.zip buildings
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
See [${CHANGELOG} ${{ github.ref }}](https://github.com/linz/nz-buildings/blob/master/${CHANGELOG}#$(echo ${{ github.ref }} | sed -e 's/[a-zA-Z\.]//g')) for detailed release information.
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./buildings.zip
asset_name: buildings.zip
asset_content_type: application/zip
- name: Upload To LINZ QGIS Plugin Repository in AWS
run: |
curl -X POST -H 'Content-Type: application/octet-stream' -H "authorization: bearer ${{ secrets.PLUGIN_REPO_AUTH }}" --data-binary @buildings.zip https://plugins.qgis.linz.govt.nz/v1/plugin/buildings