Skip to content

Commit

Permalink
[ci] Qt6 ready + improve workflow + cache testing Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids authored and nyalldawson committed Jul 24, 2021
1 parent d0a3cea commit e43bc1e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .docker/docker-compose-testing-oracle.yml
Expand Up @@ -13,7 +13,7 @@ services:

qgis-deps:
tty: true
image: qgis/qgis3-build-deps-bin-only:${DOCKER_TAG}
image: qgis3-build-deps-binary-image
volumes:
- ${GH_WORKSPACE}:/root/QGIS
links:
Expand Down
2 changes: 1 addition & 1 deletion .docker/docker-compose-testing-postgres.yml
Expand Up @@ -13,7 +13,7 @@ services:

qgis-deps:
tty: true
image: qgis/qgis3-build-deps-bin-only:${DOCKER_TAG}
image: qgis3-build-deps-binary-image
volumes:
- ${GH_WORKSPACE}:/root/QGIS
links:
Expand Down
3 changes: 1 addition & 2 deletions .docker/docker-compose-testing.yml
Expand Up @@ -10,7 +10,7 @@ services:

qgis-deps:
tty: true
image: qgis/qgis3-build-deps-bin-only:${DOCKER_TAG}
image: qgis3-build-deps-binary-image
volumes:
- ${GH_WORKSPACE}:/root/QGIS
# links:
Expand All @@ -20,4 +20,3 @@ services:
environment:
- LANG=C.UTF-8
- LC_ALL=en_US.UTF-8

9 changes: 5 additions & 4 deletions .docker/qgis3-qt6-build-deps.dockerfile
@@ -1,4 +1,4 @@
FROM fedora:rawhide
FROM fedora:rawhide as single
MAINTAINER Matthias Kuhn <matthias@opengis.ch>

RUN dnf -y install \
Expand All @@ -22,6 +22,7 @@ RUN dnf -y install \
protobuf-devel \
protobuf-lite-devel \
python3-devel \
python3-termcolor \
qt6-qt3d-devel \
qt6-qtbase-devel \
qt6-qtdeclarative-devel \
Expand All @@ -30,8 +31,9 @@ RUN dnf -y install \
qt6-qt5compat-devel \
spatialindex-devel \
sqlite-devel \
unzip

unzip \
xorg-x11-server-Xvfb \
util-linux

RUN dnf -y install wget openssl-devel && cd /usr/src \
&& wget https://github.com/KDE/qca/archive/refs/tags/v2.3.3.zip \
Expand All @@ -54,4 +56,3 @@ RUN cd /usr/src \
&& qmake6 qwt.pro \
&& make -j4 \
&& make install

58 changes: 37 additions & 21 deletions .github/workflows/run-tests.yml
Expand Up @@ -87,7 +87,6 @@ jobs:
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_REF: ${{ github.ref }}
GITHUB_PR_NUMBER: ${{github.event.number}}
DISTRO_VERSION: ${{ matrix.distro-version }}
run: |
# Be aware that these instructions are duplicated in run-tests job
DOCKER_TAG=$(echo $( [[ ${GITHUB_EVENT_NAME} =~ ^pull_request$ ]] && echo ${GITHUB_BASE_REF} || echo ${GITHUB_REF##*/} ) | sed 's/^master$/latest/')${{ matrix.docker-tag-suffix }}
Expand Down Expand Up @@ -285,9 +284,22 @@ jobs:

strategy:
matrix:
# tests run on 20.04 (Qt 5.12), compile test on 20.10 (Qt 5.14)
distro-version: [20.04]
test-batch: [ALL_BUT_PROVIDERS, POSTGRES, ORACLE, HANA]
qt-version: [5]
test-batch: [ALL_BUT_PROVIDERS, POSTGRES, HANA]
docker-target: [binary-only]

include:
- distro-version: 20.04
qt-version: 5
test-batch: ORACLE
docker-target: binary-for-oracle

# - distro-version: rawhide
# qt-version: 6
# test-batch: ALL_BUT_PROVIDERS
# docker-target: single

fail-fast: false

services:
Expand All @@ -314,30 +326,34 @@ jobs:
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_REF: ${{ github.ref }}
GITHUB_PR_NUMBER: ${{github.event.number}}
DISTRO_VERSION: ${{ matrix.distro-version }}
TEST_BATCH: ${{ matrix.test-batch }}
run: |
# Be aware that these instructions are duplicated in build job
DOCKER_TAG=$(echo $( [[ ${GITHUB_EVENT_NAME} =~ ^pull_request$ ]] && echo ${GITHUB_BASE_REF} || echo ${GITHUB_REF##*/} ) | sed 's/^master$/latest/')${{ matrix.docker-tag-suffix }}
CTEST_BUILD_NAME=$( [[ ${GITHUB_EVENT_NAME} =~ ^pull_request$ ]] && echo "PR${GITHUB_PR_NUMBER}" || echo ${GITHUB_REF##*/} )"_${GITHUB_SHA}_${TEST_BATCH}"
echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_ENV
CTEST_BUILD_NAME=$( [[ ${GITHUB_EVENT_NAME} =~ ^pull_request$ ]] && echo "PR${GITHUB_PR_NUMBER}" || echo ${GITHUB_REF##*/} )"_${GITHUB_SHA}_${{ matrix.test-batch }}"
echo "CTEST_BUILD_NAME=${CTEST_BUILD_NAME}" >> $GITHUB_ENV
- name: Print vars
run: |
echo DOCKER_TAG: ${DOCKER_TAG}
echo CTEST_BUILD_NAME: ${CTEST_BUILD_NAME}
- name: Build deps
env:
DISTRO_VERSION: ${{ matrix.distro-version }}
- name: Build Docker Container with Testing Environment
id: docker-build
uses: whoan/docker-build-with-cache-action@v5
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
image_name: qgis3-qt${{ matrix.qt-version }}-build-deps-bin-only
dockerfile: .docker/qgis3-qt${{ matrix.qt-version }}-build-deps.dockerfile
build_extra_args: "--target ${{ matrix.docker-target }} --build-arg=DISTRO_VERSION=${{ matrix.distro-version }}"
push_git_tag: true
push_image_and_stages: on:push
pull_image_and_stages: ${{ github.event_name != 'workflow_dispatch' }}

- name: Tag image
run: |
pushd .docker
TARGET=$( ( [[ ${TEST_BATCH} == "ORACLE" ]] && echo "binary-for-oracle" ) \
|| echo "binary-only" )
docker build --target $TARGET --build-arg DISTRO_VERSION=${DISTRO_VERSION} --cache-from qgis/qgis3-build-deps:${DOCKER_TAG} -t qgis/qgis3-build-deps-bin-only:${DOCKER_TAG} -f qgis3-qt5-build-deps.dockerfile .
popd
docker tag ${DOCKER_IMAGE} qgis3-build-deps-binary-image
env:
DOCKER_IMAGE: ${{ steps.docker-build.outputs.FULL_IMAGE_NAME }}

- name: Print disk space
run: |
Expand Down Expand Up @@ -368,10 +384,10 @@ jobs:
TEST_BATCH: ${{matrix.test-batch}}
QGIS_HTTPBIN_HOST: "localhost:8082"
run: |
DOCKERFILE=$( ( [[ ${TEST_BATCH} == "ORACLE" ]] && echo "docker-compose-testing-oracle.yml" ) \
|| ( [[ ${TEST_BATCH} == "POSTGRES" ]] && echo "docker-compose-testing-postgres.yml" ) \
DOCKERFILE=$( ( [[ ${{ matrix.test-batch }} == "ORACLE" ]] && echo "docker-compose-testing-oracle.yml" ) \
|| ( [[ ${{ matrix.test-batch }} == "POSTGRES" ]] && echo "docker-compose-testing-postgres.yml" ) \
|| echo "docker-compose-testing.yml" )
[[ ${TEST_BATCH} == "ORACLE" ]] && sudo rm -rf /usr/share/dotnet/sdk
[[ ${{ matrix.test-batch }} == "ORACLE" ]] && sudo rm -rf /usr/share/dotnet/sdk
echo "TEST_BATCH=$TEST_BATCH"
echo "DOCKERFILE=$DOCKERFILE"
docker-compose -f .docker/$DOCKERFILE run qgis-deps /root/QGIS/.docker/docker-qgis-test.sh $TEST_BATCH

0 comments on commit e43bc1e

Please sign in to comment.