Skip to content

Commit

Permalink
CI: add Ubuntu 23.04 jobs
Browse files Browse the repository at this point in the history
In contrast to the existing Ubuntu CI jobs, the Docker file introduced in this
commit ignores requirements.txt and doc/infosrc/requirements.txt and installs
the one Python package it needs, Pytest, from the native operating system
repositories. Debian and Ubuntu have adopted a policy change that has come into
effect in Ubuntu 23.04 that prevents Pip from installing package requirements
that conflict with system packages.¹ To work around this, we use the native
package manager instead.

The main effect of this is that CI jobs running this image do not have the
precise version of Pytest from requirements.txt. At time of writing, Pytest
7.2.1 is installed. As Graphviz’ use of Pytest is fairly basic and standard,
hopefully this will not cause problems.

An alternative would be to follow the path the policy is intended to push users
towards: creating a Python virtual environment. But this seems onerous to do for
Graphviz, something that is not a Python project, just to get testing machinery
functional.

Gitlab: closes #2382

¹ https://peps.python.org/pep-0668/
  This Github thread explains the actual observed effect and what is going on,
  python/cpython#102134 (comment).
  • Loading branch information
Smattr committed Jun 7, 2023
1 parent 88d7477 commit 0050eac
Show file tree
Hide file tree
Showing 2 changed files with 157 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,18 @@ ubuntu-22.10-build:
variables:
IMAGE: ubuntu-22.10

ubuntu-23.04-build:
<<: *deb_build_definition
needs:
- job: docker_build_ubuntu-23.04
artifacts: false
- job: portable-source
artifacts: true
tags:
- linux
variables:
IMAGE: ubuntu-23.04

out-of-source-build:
<<: *deb_build_definition
script:
Expand Down Expand Up @@ -753,6 +765,23 @@ ubuntu-22.10-cmake-build:
variables:
IMAGE: ubuntu-22.10

ubuntu-23.04-cmake-build:
<<: *deb_build_definition
needs:
- job: docker_build_ubuntu-23.04
artifacts: false
before_script:
- export build_system="cmake"
# fail on any compiler warnings
- export CFLAGS=-Werror
- export CXXFLAGS=-Werror
- export CMAKE_OPTIONS="-Dwith_cxx_tests=ON -Dwith_cxx_api=ON"
- export CMAKE_OPTIONS="$CMAKE_OPTIONS -Dwith_smyrna=ON"
tags:
- linux
variables:
IMAGE: ubuntu-23.04

ubuntu-22.04-cmake-minimal-build:
<<: *deb_build_definition
needs:
Expand Down Expand Up @@ -1088,6 +1117,18 @@ ubuntu-22.10-test:
variables:
IMAGE: ubuntu-22.10

ubuntu-23.04-test:
<<: *linux_test_definition
before_script:
- export build_system="autotools"
needs:
- job: "ubuntu-23.04-build"
artifacts: true
tags:
- linux
variables:
IMAGE: ubuntu-23.04

centos7-test:
<<: *linux_test_definition
before_script:
Expand Down Expand Up @@ -1209,6 +1250,19 @@ ubuntu-22.10-cmake-test:
variables:
IMAGE: ubuntu-22.10

ubuntu-23.04-cmake-test:
<<: *linux_test_definition
before_script:
- export build_system="cmake"
- python3 gen_version.py --output GRAPHVIZ_VERSION
needs:
- job: "ubuntu-23.04-cmake-build"
artifacts: true
tags:
- linux
variables:
IMAGE: ubuntu-23.04

ubuntu-22.10-cmake-ASan-test-including-ctest:
<<: *linux_test_definition_including_ctest
before_script:
Expand Down Expand Up @@ -1456,6 +1510,11 @@ docker_build_ubuntu-22.10:
variables:
IMAGE: ubuntu-22.10

docker_build_ubuntu-23.04:
<<: *docker_build_definition
variables:
IMAGE: ubuntu-23.04

docker_push_centos7:
<<: *docker_push_definition
variables:
Expand Down Expand Up @@ -1512,6 +1571,13 @@ docker_push_ubuntu-22.10:
needs:
- docker_build_ubuntu-22.10

docker_push_ubuntu-23.04:
<<: *docker_push_definition
variables:
IMAGE: ubuntu-23.04
needs:
- docker_build_ubuntu-23.04

lint_clang_format:
image: "$CI_REGISTRY_IMAGE/ubuntu-22.10:$CI_COMMIT_SHA"
stage: test
Expand Down
91 changes: 91 additions & 0 deletions ci/ubuntu-23.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
FROM ubuntu:23.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y \
&& apt-get install --no-install-recommends -y \
# Development tools
build-essential \
clang-format \
cmake \
git \
pkg-config \
autoconf \
bison \
libtool \
dh-python \
flex \
ksh \
# Debian build utilities
quilt \
d-shlibs \
debhelper \
fakeroot \
# Option glut
freeglut3-dev \
# Option gts
libgts-dev \
# Option swig
swig \
# Command smyra
libgtkglext1-dev \
libglade2-dev \
# Command gvedit
libqt5gui5 \
qt5-qmake \
qtbase5-dev \
# for libmingle
libann-dev \
# Plugin library devil
libdevil-dev \
# Plugin library gd
libgd-dev \
# Documentation
ghostscript \
# Plugin library ghostscipt
libgs-dev \
# Plugin library lasi
liblasi-dev \
# Plugin library poppler
libpoppler-dev \
libpoppler-glib-dev \
# Plugin library rsvg
librsvg2-dev \
# Plugin library webp
libwebp-dev \
# Language extension gv_sharp & gv_ruby
ruby \
# Language extension gv_go
golang-go \
# Language extension gv_guile
guile-2.2 \
guile-2.2-dev \
# Language extension gv_lua
lua5.3 \
liblua5.3-dev \
# Language extension gv_ocaml
ocaml \
# Language extension gv_perl
libperl-dev \
# Language extension gv_php
php-dev \
libsodium-dev \
libargon2-0-dev \
# Language extension gv_python3
libpython3-dev \
# Language extension gv_ruby
ruby-dev \
# Language extension gv_tcl
tcl-dev \
# Test utilities
python3-pytest \
python3-setuptools \
gcovr \
lcov \
# Libraries used in test
catch2 \
libboost-dev \
libfmt-dev \
libsvgpp-dev \
# Clean up
&& rm -rf /var/lib/apt/lists/*

0 comments on commit 0050eac

Please sign in to comment.