Add support for GetTranslations (requires get_translations server plu… #327
This file contains hidden or 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
name: build | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Checkout qwc-docker | |
uses: actions/checkout@master | |
with: | |
repository: qwc-services/qwc-docker | |
path: qwc-docker | |
- name: Start demo database and QGIS server | |
run: | | |
cd qwc-docker | |
cp pg_service.conf pg_service_local.conf | |
sed -i 's|host=qwc-postgis|host=localhost|g' pg_service_local.conf | |
sed -i 's|port=5432|port=5439|g' pg_service_local.conf | |
sed -i 's|qwc-qgis-server|localhost:8001|' volumes/config/default/ogcConfig.json | |
sed -i -e 's|# ports:|ports:|g' -e 's|# - "127.0.0.1| - "127.0.0.1|g' docker-compose-example.yml | |
sed -Ei "s|^(\s*POSTGRES_PASSWORD:).*$|\1 'waej7WuoOoth0wor'|" docker-compose-example.yml | |
sed -i 's|- ./volumes/qgs-resources:/data:ro|- ./volumes/qgs-resources:/data:rw|' docker-compose-example.yml | |
docker compose -f docker-compose-example.yml up -d qwc-postgis qwc-config-db-migrate qwc-qgis-server | |
- name: Setting up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Run unittests | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
cp tests/testdata/wms_test.gpkg tests/testdata/wms_test.qgs qwc-docker/volumes/qgs-resources | |
cp tests/testdata/wfs_test.gpkg tests/testdata/wfs_test.qgs qwc-docker/volumes/qgs-resources | |
chmod 777 qwc-docker/volumes/qgs-resources | |
chmod 666 qwc-docker/volumes/qgs-resources/wfs_test.gpkg | |
PGSERVICEFILE=$PWD/qwc-docker/pg_service_local.conf PYTHONPATH=$PWD/src CONFIG_PATH=$PWD/qwc-docker/volumes/config/ python3 test.py | |
- name: Validate schema | |
run: | | |
python -m pip install check-jsonschema | |
check-jsonschema --check-metaschema schemas/qwc-ogc-service.json | |
build: | |
needs: test | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@master | |
- name: Get version tag | |
id: get_tag | |
run: | | |
if [ ${{ endsWith(github.ref, '-lts') }} = true ]; then | |
echo "tag=latest-lts,latest-${GITHUB_REF:11:4}-lts,${GITHUB_REF:10}" >>$GITHUB_OUTPUT | |
else | |
echo "tag=latest,${GITHUB_REF:10}" >>$GITHUB_OUTPUT | |
fi | |
- name: Publish to Registry | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: sourcepole/${{ github.event.repository.name }} | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
tags: "${{ steps.get_tag.outputs.tag }}" |