Skip to content

Hacky fix for job preview #36

Hacky fix for job preview

Hacky fix for job preview #36

name: 👨‍⚖️ Run Python Plugin Tests
on:
push:
paths:
- "animation_workbench/**"
- ".github/workflows/test_plugin.yaml"
pull_request:
paths:
- "animation_workbench/**"
- ".github/workflows/test_plugin.yaml"
# Allow manually running in the actions tab
workflow_dispatch:
env:
# plugin name/directory where the code for the plugin is stored
PLUGIN_NAME: animation_workbench
# python notation to test running inside plugin
TESTS_RUN_FUNCTION: animation_workbench.test_suite.test_package
# Docker settings
DOCKER_IMAGE: qgis/qgis
jobs:
Test-plugin-animation_workbench:
runs-on: ubuntu-latest
strategy:
matrix:
# requires QGIS >= 3.26
docker_tags: [latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker pull and create qgis-testing-environment
run: |
docker pull "$DOCKER_IMAGE":${{ matrix.docker_tags }}
docker run -d --name qgis-testing-environment -v "$GITHUB_WORKSPACE":/tests_directory -e DISPLAY=:99 "$DOCKER_IMAGE":${{ 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_TESTING.txt"
docker exec qgis-testing-environment sh -c "apt-get update"
docker exec qgis-testing-environment sh -c "apt-get install -y python3-pyqt5.qtmultimedia ffmpeg imagemagick"
- name: Docker run plugin tests
run: |
docker exec qgis-testing-environment sh -c "qgis_testrunner.sh $TESTS_RUN_FUNCTION"
Check-code-quality:
runs-on: ubuntu-latest
steps:
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: '3.8'
architecture: 'x64'
- name: Checkout
uses: actions/checkout@v2
- name: Install packages
run: |
pip install -r REQUIREMENTS_TESTING.txt
pip install pylint pycodestyle
- name: Pylint
run: make pylint
#- name: Pycodestyle
# run: make pycodestyle