From: Magnus Jacobsson Date: Sat, 11 Apr 2020 09:36:02 +0000 (+0200) Subject: Move test code from .gitlab-ci.yml to new ci/test.sh script X-Git-Tag: 2.44.1~79^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56a4196d4b417f2d9cd5c7a529ea3541e47ea3bc;p=graphviz Move test code from .gitlab-ci.yml to new ci/test.sh script --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 18c5997ca..aef2507fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,21 +48,10 @@ portable-source: except: - tags -.test_template: &deb_test_definition +.test_template: &test_definition stage: test script: - - cat /etc/os-release - - GV_VERSION=$( cat VERSION ) - - COLLECTION=$( cat COLLECTION ) - - zcat graphviz-${GV_VERSION}.tar.gz | tar xf - - - . /etc/os-release - - DIR=Packages/${COLLECTION}/${ID}/${VERSION_ID} - - ARCH=$( uname -m ) - - apt install ./${DIR}/os/${ARCH}/libgraphviz4_${GV_VERSION}-1_amd64.deb - - apt install ./${DIR}/os/${ARCH}/graphviz_${GV_VERSION}-1_amd64.deb - - cd graphviz-${GV_VERSION} - - ./configure - - make -C tests/regression_tests/shapes check + - ci/test.sh centos6-build: <<: *rpm_build_definition @@ -149,19 +138,19 @@ ubuntu19-10-build: image: "graphviz/graphviz:ubuntu-19.10" ubuntu18-04-test: - <<: *deb_test_definition + <<: *test_definition tags: - linux image: "graphviz/graphviz:ubuntu-18.04" ubuntu19-04-test: - <<: *deb_test_definition + <<: *test_definition tags: - linux image: "graphviz/graphviz:ubuntu-19.04" ubuntu19-10-test: - <<: *deb_test_definition + <<: *test_definition tags: - linux image: "graphviz/graphviz:ubuntu-19.10" diff --git a/ci/test.sh b/ci/test.sh new file mode 100755 index 000000000..bcce40c2c --- /dev/null +++ b/ci/test.sh @@ -0,0 +1,28 @@ +#!/bin/sh -e + +set -x + +if test -f /etc/os-release; then + cat /etc/os-release + . /etc/os-release +else + cat /etc/redhat-release + ID=$( cat /etc/redhat-release | cut -d' ' -f1 | tr 'A-Z' 'a-z' ) + VERSION_ID=$( cat /etc/redhat-release | cut -d' ' -f3 | cut -d'.' -f1 ) +fi +GV_VERSION=$( cat VERSION ) +COLLECTION=$( cat COLLECTION ) +tar xfz graphviz-${GV_VERSION}.tar.gz +DIR=Packages/${COLLECTION}/${ID}/${VERSION_ID} +ARCH=$( uname -m ) +if [ "${ID_LIKE}" = "debian" ]; then + apt install ./${DIR}/os/${ARCH}/libgraphviz4_${GV_VERSION}-1_amd64.deb + apt install ./${DIR}/os/${ARCH}/graphviz_${GV_VERSION}-1_amd64.deb +else + rpm --install --force ${DIR}/os/${ARCH}/*.rpm +fi +cd graphviz-${GV_VERSION} +./configure +ln -s /usr/bin/dot cmd/dot/dot_builtins +ln -s /usr/bin/diffimg contrib/diffimg/diffimg +make -C tests/regression_tests/shapes check