Skip to content

cleanup code

cleanup code #193

# workflow name
name: Tests
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the wanted branches
on: [push, pull_request]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
linux_docker_tests:
runs-on: ubuntu-latest
strategy:
matrix:
# 'latest' seems to be nightly build, 'stable' is latest real release
docker_tags: ['final-3_34_0','final-3_36_0','3.38.0','3.40.0','ltr', 'stable', 'latest']
fail-fast: false
container:
image: qgis/qgis:${{ matrix.docker_tags }}
env:
QGIS_PLUGIN_IN_CI: 1
PIP_BREAK_SYSTEM_PACKAGES: 1
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Environment
run: |
add-apt-repository universe
apt-get update
apt-get -y install python3-geopandas
apt-get -y install python3-networkx
pip3 install -r requirements-ci-tests.txt
- name: Run Tests
run: xvfb-run -s '+extension GLX -screen 0 1024x768x24' python3 -m pytest -v
# linux_tests:
# # The type of runner that the job will run on
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# # Remove unsupported versions and add more versions. Use LTR version in the cov_tests job
# docker_tags: [final-3_34_0, 'ltr','3.38.3', latest]
# os: [ubuntu-latest]
# fail-fast: false
# # Steps represent a sequence of tasks that will be executed as part of the job
# steps:
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# - uses: actions/checkout@v4
# with:
# submodules: true
# - name: Pull qgis
# run: docker pull qgis/qgis:${{ matrix.docker_tags }}
# # Runs all tests
# - name: Run tests
# run: >
# docker run --rm --net=host --volume `pwd`:/app -w=/app -e QGIS_PLUGIN_IN_CI=1 -e PIP_BREAK_SYSTEM_PACKAGES=1 qgis/qgis:${{ matrix.docker_tags }} sh -c
# "apt-get update &&
# apt-get -y install python3-geopandas &&
# apt-get -y install python3-networkx &&
# pip3 install -qr requirements-dev.txt && xvfb-run -s '+extension GLX -screen 0 1024x768x24'
# pytest -v --cov=wntrqgis --cov-report=xml tests/"
# # Upload coverage report. Will not work if the repo is private
# - name: Upload coverage to Codecov
# if: ${{ matrix.docker_tags == 'latest' && !github.event.repository.private }}
# uses: codecov/codecov-action@v1
# with:
# file: ./coverage.xml
# flags: unittests
# fail_ci_if_error: false # set to true when upload is working
# verbose: false
windows_choco:
runs-on: windows-latest
strategy:
matrix:
# does not work with 3.28.0 due to missing geopandas
qgis_version: ['3.34.0','3.40.0']
fail-fast: false
env:
QGIS_PLUGIN_IN_CI: 1
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Choco install qgis
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install qgis --version=${{ matrix.qgis_version }} -y
- name: Setup Environmment
shell: pwsh
run: |
$env:PATH="C:\Program Files\QGIS ${{ matrix.qgis_version }}\bin;$env:PATH"
python-qgis.bat -m pip install -r requirements-ci-tests.txt
- name: Run Tests
shell: pwsh
run: |
$env:PATH="C:\Program Files\QGIS ${{ matrix.qgis_version }}\bin;$env:PATH"
python-qgis.bat -m pytest -v