This repository was archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
72 lines (59 loc) · 2.29 KB
/
test_qgis_plugin.yml
File metadata and controls
72 lines (59 loc) · 2.29 KB
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
name: Test plugin
on:
push:
branches:
- master
paths:
- "qgis/examples/quick_api_interactive_proper/**"
- ".github/workflows/test_qgis_plugin.yaml"
pull_request:
branches:
- master
paths:
- "qgis/examples/quick_api_interactive_proper/**"
- ".github/workflows/test_qgis_plugin.yaml"
env:
# plugin name/directory where the code for the plugin is stored
PLUGIN_NAME: quick_api
PLUGIN_PATH: qgis/examples/quick_api_interactive_proper_testing
# python notation to test running inside plugin
TESTS_RUN_FUNCTION: quick_api.test_suite.test_package
jobs:
Tests:
runs-on: ubuntu-latest
strategy:
matrix:
docker_tags: [release-3_16, release-3_18, latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker pull and create container
run: |
docker pull qgis/qgis:${{ matrix.docker_tags }}
docker run -d --name qgis-testing-environment -v "${GITHUB_WORKSPACE}/${PLUGIN_PATH}":/tests_directory -e DISPLAY=:99 qgis/qgis:${{ matrix.docker_tags }}
- name: Docker set up QGIS
run: |
docker exec qgis-testing-environment sh -c "qgis_setup.sh $PLUGIN_NAME"
docker exec qgis-testing-environment sh -c "rm -f /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/$PLUGIN_NAME"
docker exec qgis-testing-environment sh -c "ln -s /tests_directory/$PLUGIN_NAME /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/$PLUGIN_NAME"
docker exec qgis-testing-environment sh -c "pip3 install -r /tests_directory/requirements-tests.txt"
- name: Docker run plugin tests
run: |
docker exec qgis-testing-environment sh -c "qgis_testrunner.sh $TESTS_RUN_FUNCTION"
Lint:
runs-on: ubuntu-latest
steps:
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: '3.9'
architecture: 'x64'
- name: Checkout
uses: actions/checkout@v2
- name: Install packages
run: |
cd "${GITHUB_WORKSPACE}/${PLUGIN_PATH}" && pip install -r requirements-tests.txt
- name: Flake8
run: cd "${GITHUB_WORKSPACE}/${PLUGIN_PATH}" && flake8 .
- name: Black
run: cd "${GITHUB_WORKSPACE}/${PLUGIN_PATH}" && black . --check