]> granicus.if.org Git - graphviz/commitdiff
add an out-of-source build to CI
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 6 Jun 2021 18:18:56 +0000 (11:18 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 12 Jun 2021 19:02:38 +0000 (12:02 -0700)
The existing CI tasks run an uncommon work flow: building distributable packages
on each operating system. A more common work flow end users will be following
with the portable source tarball is simply building and installing it. This
change adds a job that does this, to provide a safeguard against breaking this
work flow in future.

The added job runs on Ubuntu 21.04. The intent is to bump this job to the latest
each time there is a new Ubuntu release. There is no companion test job for the
build job because we assume the existing test jobs are providing sufficient
coverage.

Closes #2073.

.gitlab-ci.yml
ci/out-of-source-build.sh [new file with mode: 0755]

index 32b56f580dd4eacc4075d3f964bee7a0607c1463..5c6b847ad06de1650bf5f9948e1ec5c33249f579 100644 (file)
@@ -349,6 +349,29 @@ ubuntu21-04-build:
     variables:
       IMAGE: ubuntu-21.04
 
+out-of-source-build:
+    <<: *deb_build_definition
+    script:
+        - logfile=`mktemp`
+        - ci/out-of-source-build.sh |& tee $logfile
+        - echo "$CI_JOB_NAME-warnings `grep -c 'warning:' $logfile`" > metrics.txt
+        - rm $logfile
+        - cat metrics.txt
+    needs:
+        - job: docker_build_ubuntu-21.04
+          artifacts: false
+        - job: portable-source
+          artifacts: true
+    tags:
+        - linux
+    artifacts:
+        when: on_success
+        expire_in: 1 week
+        reports:
+            metrics: metrics.txt
+    variables:
+      IMAGE: ubuntu-21.04
+
 macos-autotools-build:
     <<: *macos_build_definition
     before_script:
diff --git a/ci/out-of-source-build.sh b/ci/out-of-source-build.sh
new file mode 100755 (executable)
index 0000000..8ab01de
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+# this script does something close to the work flow end users may follow when
+# building Graphviz
+
+set -x
+set -e
+set -o pipefail
+
+# output some info for debugging
+uname -rms
+cat /etc/os-release
+
+GV_VERSION=$(cat VERSION)
+
+# unpack the portable source tarball
+tar xfz graphviz-${GV_VERSION}.tar.gz
+
+# setup a directory for building in
+mkdir build
+cd build
+../graphviz-${GV_VERSION}/configure
+
+# build Graphviz
+make
+
+# install Graphviz
+make install