Skip to content

Commit fe4160c

Browse files
committed
Github actions and docker files updated, and clean up
1 parent 5c987bf commit fe4160c

File tree

10 files changed

+84
-309
lines changed

10 files changed

+84
-309
lines changed

.docker/Dockerfile

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@ ARG QGIS_TEST_VERSION=latest
22
FROM qgis/qgis:${QGIS_TEST_VERSION}
33

44
# Install system dependencies
5-
RUN apt-get clean && \
6-
rm -rf /var/lib/apt/lists/* && \
7-
apt-get update -o Acquire::Retries=3 && \
8-
apt-get install -y --no-install-recommends \
9-
python3-pip \
10-
xvfb \
11-
xauth \
12-
&& apt-get clean \
13-
&& rm -rf /var/lib/apt/lists/*
5+
RUN apt-get update && \
6+
apt-get install -y --no-install-recommends python3-pip && \
7+
apt-get clean && \
8+
rm -rf /var/lib/apt/lists/*
149

15-
# Copy and install Python test dependencies
16-
COPY ./requirements_test.txt /tmp/
17-
RUN pip3 install --no-cache-dir -r /tmp/requirements_test.txt --break-system-packages
10+
COPY ./pyproject.toml /tmp/
11+
RUN pip3 install "/tmp/.[test]" --break-system-packages
1812

1913
# Set environment variables
2014
ENV LANG=C.UTF-8
@@ -23,4 +17,4 @@ ENV IS_DOCKER_CONTAINER=true
2317
ENV QT_QPA_PLATFORM=offscreen
2418
ENV DISPLAY=:99
2519

26-
WORKDIR /usr/src
20+
WORKDIR /

.docker/docker-compose.gh.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ services:
44
context: ..
55
dockerfile: ./.docker/Dockerfile
66
args:
7-
QGIS_TEST_VERSION: ${QGIS_TEST_VERSION}
7+
QGIS_TEST_VERSION: ${QGIS_TEST_VERSION:-latest}
88
tty: true
99
volumes:
10-
- ${GITHUB_WORKSPACE}:/usr/src/ThRasE
10+
- ${GITHUB_WORKSPACE:-.}:/usr/src/ThRasE
11+
working_dir: /usr/src/ThRasE

.docker/run-docker-tests.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
pushd /usr/src
6-
DEFAULT_PARAMS='./ThRasE/tests/ -v --qgis_disable_gui --qgis_disable_init'
7-
xvfb-run -a -s "-screen 0 1920x1080x24" pytest ${@:-`echo $DEFAULT_PARAMS`}
8-
popd
5+
cd /usr/src/ThRasE
6+
7+
DEFAULT_PARAMS='./tests/ -v --qgis_disable_gui --qgis_disable_init'
8+
xvfb-run pytest ${@:-$DEFAULT_PARAMS}

.docker/run-tests.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/build_docs.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- "docs/**"
99

1010
concurrency:
11-
group: "pages"
11+
group: pages
1212
cancel-in-progress: false
1313

1414
permissions:
@@ -18,24 +18,24 @@ jobs:
1818
build-docs:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v4
22-
23-
- name: "Set up Python 3.10"
24-
uses: actions/setup-python@v4
25-
with:
26-
python-version: "3.10"
27-
28-
- name: Install dependencies
29-
run: |
30-
python -m pip install --upgrade pip
31-
pip install -r requirements_docs.txt
32-
33-
- name: Build
34-
run: |
35-
jupyter-book build docs
36-
37-
- name: Deploy to GitHub Pages
38-
uses: peaceiris/actions-gh-pages@v4
39-
with:
40-
github_token: ${{ secrets.GITHUB_TOKEN }}
41-
publish_dir: docs/_build/html
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.12"
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install ".[docs]"
33+
34+
- name: Build documentation
35+
run: jupyter-book build docs
36+
37+
- name: Deploy to GitHub Pages
38+
uses: peaceiris/actions-gh-pages@v4
39+
with:
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
41+
publish_dir: docs/_build/html

.github/workflows/tests.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,39 @@ name: Tests
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
jobs:
1010
tests:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
docker_tags: [ ltr, stable ]
14+
qgis_version: [ltr, stable]
1515
fail-fast: false
16+
1617
env:
17-
QGIS_TEST_VERSION: ${{ matrix.docker_tags }}
18+
QGIS_TEST_VERSION: ${{ matrix.qgis_version }}
1819

1920
steps:
2021
- name: Checkout
2122
uses: actions/checkout@v4
2223
with:
2324
submodules: recursive
25+
lfs: true
26+
27+
- name: Set up Git LFS
28+
run: |
29+
git lfs install
30+
git lfs pull
31+
32+
- name: Build Docker image
33+
run: docker compose -f .docker/docker-compose.gh.yml build
2434

25-
- name: Pull QGIS Docker image
26-
run: docker pull qgis/qgis:${QGIS_TEST_VERSION}
35+
- name: Run tests
36+
run: docker compose -f .docker/docker-compose.gh.yml run --rm qgis /usr/src/ThRasE/.docker/run-docker-tests.sh
2737

28-
- name: Run tests with Docker
29-
run: docker compose -f .docker/docker-compose.gh.yml run qgis /usr/src/ThRasE/.docker/run-docker-tests.sh
38+
- name: Cleanup
39+
if: always()
40+
run: docker compose -f .docker/docker-compose.gh.yml down --rmi local

Makefile

Lines changed: 0 additions & 235 deletions
This file was deleted.

0 commit comments

Comments
 (0)