Merge pull request #7 from JanCaha/refactor_ramps #67
This file contains 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: Tests for Plugin BivariateRenderer | |
on: | |
push: | |
paths: | |
- "BivariateRenderer/**" | |
- "tests/**" | |
- ".github/workflows/test_plugin.yaml" | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
QT_QPA_PLATFORM: offscreen | |
XDG_RUNTIME_DIR: /tmp | |
PYTHONPATH: /usr/share/qgis/python/plugins:/usr/share/qgis/python:./qgis-plugin-bivariate-renderer | |
jobs: | |
Tests-plugin-BivariateRenderer: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- 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: Install Python packages | |
run: | | |
pip install --no-cache-dir pytest pytest-qgis pytest-cov pillow flake8 mypy pycodestyle pb_tool pytest-qt pixelmatch --break-system-packages | |
- name: Print Dir | |
run: | | |
ls -la | |
- name: Run tests | |
run: | | |
pytest tests --cov=BivariateRenderer --cov-report=term-missing:skip-covered -rP -vv -s --ignore=tests/tests_visual_result_generation | |
- name: Upload Artifact | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
if-no-files-found: warn | |
name: artifacts | |
path: /tmp/images_diff |