-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (58 loc) · 3.25 KB
/
test_plugin.yaml
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: Tests for Plugin LoS Tools
on:
push:
paths:
- "los_tools/**"
- ".github/workflows/test_plugin.yaml"
- "tests/**"
jobs:
Tests-plugin-LoS-Tools:
runs-on: ubuntu-24.04
steps:
- name: Install
run: |
sudo apt-get install python3-pytest python3-pytest-cov
- name: Prepare QGIS
run: |
sudo gpg -k && \
KEYRING=/usr/share/keyrings/qgis-archive-keyring.gpg && \
wget -O $KEYRING https://download.qgis.org/downloads/qgis-archive-keyring.gpg && \
sudo touch /etc/apt/sources.list.d/qgis.sources && \
echo 'Types: deb deb-src' | sudo tee -a /etc/apt/sources.list.d/qgis.sources && \
echo 'URIs: https://qgis.org/ubuntugis' | sudo tee -a /etc/apt/sources.list.d/qgis.sources && \
echo 'Suites: '$(lsb_release -c -s) | sudo tee -a /etc/apt/sources.list.d/qgis.sources && \
echo 'Architectures: '$(dpkg --print-architecture) | sudo tee -a /etc/apt/sources.list.d/qgis.sources && \
echo 'Components: main' | sudo tee -a /etc/apt/sources.list.d/qgis.sources && \
echo 'Signed-By: '$KEYRING | sudo tee -a /etc/apt/sources.list.d/qgis.sources && \
LASTSUPPORTED=focal && \
KEYRING=/usr/share/keyrings/ubuntugis-archive-keyring.gpg && \
sudo gpg --no-default-keyring --keyring $KEYRING --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 6B827C12C2D425E227EDCA75089EBE08314DF160 && \
sudo touch /etc/apt/sources.list.d/ubuntugis-unstable.sources && \
echo 'Types: deb deb-src' | sudo tee -a /etc/apt/sources.list.d/ubuntugis-unstable.sources && \
echo 'URIs:https://ppa.launchpadcontent.net/ubuntugis/ubuntugis-unstable/ubuntu' | sudo tee -a /etc/apt/sources.list.d/ubuntugis-unstable.sources && \
echo 'Suites: '$(lsb_release -c -s)| sudo tee -a /etc/apt/sources.list.d/ubuntugis-unstable.sources && \
echo 'Architectures: '$(dpkg --print-architecture) | sudo tee -a /etc/apt/sources.list.d/ubuntugis-unstable.sources && \
echo 'Components: main' | sudo tee -a /etc/apt/sources.list.d/ubuntugis-unstable.sources && \
echo 'Signed-By: '$KEYRING | sudo tee -a /etc/apt/sources.list.d/ubuntugis-unstable.sources
- name: Install
run: |
sudo apt-get update && \
sudo apt-get -y -q install --no-install-recommends wget software-properties-common build-essential ca-certificates python3-pip dialog apt-utils && \
sudo apt -y -q install qgis qgis-dev qgis-plugin-grass
- name: QGIS Version
run: qgis --version
- name: Install Python packages
run: pip install pytest-qgis --break-system-packages
- name: Checkout
uses: actions/checkout@v4
- name: Add Python Path
run: |
echo "PYTHONPATH=$PYTHONPATH:/usr/share/qgis/python/plugins:/usr/share/qgis/python:$PWD" >> $GITHUB_ENV
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
echo "QT_QPA_PLATFORM=offscreen" >> $GITHUB_ENV
echo "XDG_RUNTIME_DIR=/tmp" >> $GITHUB_ENV
- name: Print Python Path
run: echo $PYTHONPATH
- name: Run Tests
run: |
pytest tests --cov=los_tools --cov-report=term-missing:skip-covered -rP -s