Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Apr 4, 2024
0 parents commit 88537c0
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: monthly

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
57 changes: 57 additions & 0 deletions .github/workflows/plugin-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 🔌 Plugin | Package and release

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:


jobs:
plugin-package:
name: Packages and releases plugin
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install Qt lrelease
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev qttools5-dev-tools
- name: Install qgis-plugin-ci
run: pip install qgis-plugin-ci>=2.8.6

- name: 🌍 Push translations
if: ${{ github.event_name == 'push' }}
run: qgis-plugin-ci push-translation ${{ secrets.TX_TOKEN }}

- name: Package PyPI Packages
run: ./plugin/scripts/package-pip-packages.sh

- name: Package
run: |
VERSION=0.0.0
qgis-plugin-ci -v package ${VERSION} \
--allow-uncommitted-changes \
--asset-path plugin/pg_service_parser_dev/libs \
--transifex-token "${{ secrets.TX_TOKEN }}"
- uses: actions/upload-artifact@v4
with:
name: pg_service_parser_dev
path: plugin/pg_service_parser.0.0.0.zip
if-no-files-found: error
66 changes: 66 additions & 0 deletions .github/workflows/plugin-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: 🪲 Plugin | Tests

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
push:
branches:
- main
paths:
- datamodel/**
- plugin/**
- '.github/workflows/plugin-test.yml'
pull_request:
branches:
- main
paths:
- datamodel/**
- plugin/**
- '.github/workflows/plugin-test.yml'
workflow_dispatch:


jobs:
plugin-tests:
name: Run unit tests on plugin
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
qgis_version: [3.28-jammy, latest]
env:
QGIS_TEST_VERSION: ${{ matrix.qgis_version }}
COMPOSE_PROFILES: qgis

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Package PyPI Packages
run: sudo ./plugin/scripts/package-pip-packages.sh

- name: Download Interlis libs
run: sudo ./plugin/scripts/download-interlis-libs.sh

- name: Docker build
run: docker compose up -d --build

- name: Test on QGIS
run: docker-compose run qgis /usr/src/plugin/.docker/run-docker-tests.sh

- name: Test command line import orgs
run: docker-compose run qgis sh -c 'xvfb-run /usr/src/plugin/tww_cmd.py interlis_import --xtf_file /usr/src/plugin/teksi_wastewater/tests/data/minimal-dataset-organisation-arbon-only.xtf --pghost db --pgdatabase tww --pguser postgres --pgpass postgres --pgport 5432'

- name: Test command line import minimal sia405
run: docker-compose run qgis sh -c 'xvfb-run /usr/src/plugin/tww_cmd.py interlis_import --xtf_file /usr/src/plugin/teksi_wastewater/tests/data/minimal-dataset-SIA405-ABWASSER.xtf --pghost db --pgdatabase tww --pguser postgres --pgpass postgres --pgport 5432'

- name: Test command line minimal export
run: docker-compose run qgis sh -c 'xvfb-run /usr/src/plugin/tww_cmd.py interlis_export --xtf_file "output.xtf" --pghost db --pgdatabase tww --pguser postgres --pgpass postgres --pgport 5432'

- name: docker logs
#if: failure()
run: docker compose logs db
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pg_service_parser/libs
9 changes: 9 additions & 0 deletions .qgis-plugin-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugin_path: pg_service_parser
github_organization_slug: opengisch
project_slug: qgis-pg-service-parser-plugin

transifex_coordinator: geoninja
transifex_resource: swiss_locator
translation_languages:
- fr
- de
20 changes: 20 additions & 0 deletions scripts/package-pip-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

LIBS_DIR="pg_service_parser/libs"

echo download and unpack pgserviceparser
#create temp folder
mkdir -p temp
#download the wheel
pip download -v pgserviceparser --only-binary :all: -d temp/
#unpack all the wheels found (means including dependencies)
unzip -o "temp/*.whl" -d $LIBS_DIR
#remove temp folder
rm -r temp
#set write rights to group (because qgis-plugin-ci needs it)
chmod -R g+w $LIBS_DIR

#create the __init__.py in libs folder
cd $LIBS_DIR
touch __init__.py
chmod g+w __init__.py

0 comments on commit 88537c0

Please sign in to comment.