diff --git a/.docker/Dockerfile b/.docker/Dockerfile deleted file mode 100644 index c31860a..0000000 --- a/.docker/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -ARG QGIS_TEST_VERSION=latest -FROM qgis/qgis:${QGIS_TEST_VERSION} -MAINTAINER Matthias Kuhn - -RUN apt-get update \ - && apt-get install -y python3-pip \ - && rm -rf /var/lib/apt/lists/* - -COPY ./requirements.txt /tmp/ - -# images for QGIS<=3.34 uses much older `pip` that does not support `--break-system-packages` -RUN pip3 install -r /tmp/requirements.txt || pip3 install -r /tmp/requirements.txt --break-system-packages - -ENV PYTHONPATH=/usr/share/qgis/python/plugins -ENV LANG=C.UTF-8 - -COPY ./ /usr/src/ -RUN chmod a+x /usr/src/.docker/run-docker-tests.sh - -WORKDIR / \ No newline at end of file diff --git a/.docker/run-docker-tests.sh b/.docker/run-docker-tests.sh deleted file mode 100644 index ef51ecc..0000000 --- a/.docker/run-docker-tests.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -#*************************************************************************** -# ------------------- -# begin : 2017-08-24 -# git sha : :%H$ -# copyright : (C) 2017 by OPENGIS.ch -# email : info@opengis.ch -#*************************************************************************** -# -#*************************************************************************** -#* * -#* This program is free software; you can redistribute it and/or modify * -#* it under the terms of the GNU General Public License as published by * -#* the Free Software Foundation; either version 2 of the License, or * -#* (at your option) any later version. * -#* * -#*************************************************************************** -set -e - -pushd /usr/src/ -xvfb-run pytest -popd \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 44de453..4b95d1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,21 +8,28 @@ on: branches: - main +env: + QGIS_TEST_VERSION: latest + jobs: test: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - qgis_version: [latest,3.34.14-noble,final-3_28_15] # QGIS 3.28, 3.34.x and latest + qgis_version: [ latest,3.34.14-noble,final-3_28_15 ] # QGIS 3.28, 3.34.x and latest env: QGIS_TEST_VERSION: ${{ matrix.qgis_version }} + steps: - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: - submodules: recursive - - name: Build docker image - run: docker build . -f .docker/Dockerfile -t docker_qgis --build-arg QGIS_TEST_VERSION=${QGIS_TEST_VERSION} - - name: Test on QGIS - run: docker run --rm -v $GITHUB_WORKSPACE:/usr/src docker_qgis bash /usr/src/.docker/run-docker-tests.sh + submodules: true + + - name: Unit tests + run: >- # The pip install instruction was only added to support QGIS 3.28.x. It can be removed when removing that QGIS version. + docker run + -e PYTHONPATH=/usr/share/qgis/python/plugins + -v $(pwd):/usr/src + -w /usr/src qgis/qgis:${QGIS_TEST_VERSION} + sh -c 'pip3 install -r requirements.txt || pip3 install -r requirements.txt --break-system-packages;xvfb-run pytest' \ No newline at end of file