-
Notifications
You must be signed in to change notification settings - Fork 14
63 lines (48 loc) · 2.63 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
name: Test plugin
on:
push:
paths:
- "processing_r/**"
- ".github/workflows/test_plugin.yaml"
pull_request:
types: [opened, synchronize, edited]
env:
# plugin name/directory where the code for the plugin is stored
PLUGIN_NAME: processing_r
# python notation to test running inside plugin
TESTS_RUN_FUNCTION: processing_r.test_suite.test_package
# Docker settings
DOCKER_IMAGE: qgis/qgis
PYTHON_SETUP: "PYTHONPATH=/usr/share/qgis/python/:/usr/share/qgis/python/plugins:/usr/lib/python3/dist-packages/qgis:/usr/share/qgis/python/qgis:/tests_directory"
jobs:
Test-plugin-Processing-R:
runs-on: ubuntu-latest
strategy:
matrix:
docker_tags: [release-3_28, release-3_30, release-3_32, release-3_34, latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker pull and create qgis-test-env
run: |
docker pull "$DOCKER_IMAGE":${{ matrix.docker_tags }}
docker run -d --name qgis-test-env -v "$GITHUB_WORKSPACE":/tests_directory -e DISPLAY=:99 "$DOCKER_IMAGE":${{ matrix.docker_tags }}
- name: Docker set up
run: |
docker exec qgis-test-env sh -c "pip3 install -r /tests_directory/REQUIREMENTS_TESTING.txt"
docker exec qgis-test-env sh -c "apt-get update"
docker exec qgis-test-env sh -c "apt-get install -y --no-install-recommends wget ca-certificates gnupg"
- name: Add Keys and Sources for R and binary packages
run: |
docker exec qgis-test-env sh -c "wget -q -O- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc"
docker exec qgis-test-env sh -c "echo \"deb [arch=amd64] https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/\" > /etc/apt/sources.list.d/cran_r.list"
docker exec qgis-test-env sh -c "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 67C2D66C4B1D4339 51716619E084DAB9"
docker exec qgis-test-env sh -c "wget -q -O- https://eddelbuettel.github.io/r2u/assets/dirk_eddelbuettel_key.asc | tee -a /etc/apt/trusted.gpg.d/cranapt_key.asc"
docker exec qgis-test-env sh -c "echo \"deb [arch=amd64] https://r2u.stat.illinois.edu/ubuntu jammy main\" > /etc/apt/sources.list.d/cranapt.list"
- name: Install R and necessary packages
run: |
docker exec qgis-test-env sh -c "apt update -qq"
docker exec qgis-test-env sh -c "apt-get install -y r-base r-cran-sf r-cran-raster"
- name: Docker run plugin tests
run: |
docker exec qgis-test-env sh -c "$PYTHON_SETUP && cd tests_directory && pytest"