generated from teksi/template
-
Notifications
You must be signed in to change notification settings - Fork 5
77 lines (60 loc) · 2.64 KB
/
plugin-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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-22.04
strategy:
fail-fast: false
matrix:
qgis_version: [3.34-jammy, latest]
env:
QGIS_TEST_VERSION: ${{ matrix.qgis_version }}
COMPOSE_PROFILES: qgis
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup env
run: cp .env.example .env
- 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 --profile qgis up -d --build
- name: Test on QGIS
run: docker compose run qgis /usr/src/plugin/.docker/run-docker-tests.sh --deselect teksi_wastewater/tests/test_interlis.py::TestInterlis::test_dss_dataset_import_export
- name: Clear Database
run: docker compose exec db init_db.sh build
- name: Test on QGIS DSS dataset
run: docker compose run qgis /usr/src/plugin/.docker/run-docker-tests.sh teksi_wastewater/tests/test_interlis.py::TestInterlis::test_dss_dataset_import_export
- name: Clear Database
run: docker compose exec db init_db.sh build
- 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
run: docker compose logs db