From 73f8f4b98b479de6db4dedda53786c2e31e8c87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Sat, 18 Sep 2021 11:59:31 +0200 Subject: Move CI-scripts into seperate subdir. --- .github/workflows/codecov.yml | 6 +-- .github/workflows/codeql.yml | 4 +- .github/workflows/config-matrix.yml | 6 +-- .github/workflows/coverity.yml | 4 +- .github/workflows/distcheck.yml | 4 +- .github/workflows/memcheck.yml | 12 ++--- build-aux/ci-log-dependency-versions | 79 --------------------------------- build-aux/ci-log-logfiles | 16 ------- build-aux/ci/ci-log-dependency-versions | 79 +++++++++++++++++++++++++++++++++ build-aux/ci/ci-log-logfiles | 16 +++++++ build-aux/ci/clang-gcov-wrapper | 2 + build-aux/ci/configure-wrapper | 10 +++++ build-aux/ci/summarize-coverage | 24 ++++++++++ build-aux/clang-gcov-wrapper | 2 - build-aux/configure-wrapper | 10 ----- build-aux/summarize-coverage | 24 ---------- 16 files changed, 149 insertions(+), 149 deletions(-) delete mode 100755 build-aux/ci-log-dependency-versions delete mode 100755 build-aux/ci-log-logfiles create mode 100755 build-aux/ci/ci-log-dependency-versions create mode 100755 build-aux/ci/ci-log-logfiles create mode 100755 build-aux/ci/clang-gcov-wrapper create mode 100755 build-aux/ci/configure-wrapper create mode 100755 build-aux/ci/summarize-coverage delete mode 100755 build-aux/clang-gcov-wrapper delete mode 100755 build-aux/configure-wrapper delete mode 100755 build-aux/summarize-coverage diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index adc1667..7a08f05 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -66,7 +66,7 @@ jobs: - name: Versions of build tools id: build-tools - run: ./build-aux/ci-log-dependency-versions + run: ./build-aux/ci/ci-log-dependency-versions - name: Get nprocs run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV @@ -106,7 +106,7 @@ jobs: run: make -j${{ env.NPROCS }} check - name: Summarize coverage data - run: ./build-aux/summarize-coverage coverage.info + run: ./build-aux/ci/summarize-coverage coverage.info - name: Upload coverage data to Codecov uses: codecov/codecov-action@v2 @@ -116,4 +116,4 @@ jobs: - name: Detailed error logs if: failure() - run: ./build-aux/ci-log-logfiles + run: ./build-aux/ci/ci-log-logfiles diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 23996d2..66579f3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -53,7 +53,7 @@ jobs: - name: Versions of build tools id: build-tools - run: ./build-aux/ci-log-dependency-versions + run: ./build-aux/ci/ci-log-dependency-versions - name: Get nprocs run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV @@ -94,4 +94,4 @@ jobs: - name: Detailed error logs if: failure() - run: ./build-aux/ci-log-logfiles + run: ./build-aux/ci/ci-log-logfiles diff --git a/.github/workflows/config-matrix.yml b/.github/workflows/config-matrix.yml index 03c8c02..4c4e51d 100644 --- a/.github/workflows/config-matrix.yml +++ b/.github/workflows/config-matrix.yml @@ -82,7 +82,7 @@ jobs: - name: Versions of build tools id: build-tools - run: ./build-aux/ci-log-dependency-versions + run: ./build-aux/ci/ci-log-dependency-versions - name: Get nprocs run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV @@ -111,7 +111,7 @@ jobs: run: ./autogen.sh - name: Configure - run: ./build-aux/configure-wrapper $CONFIG_OPTS + run: ./build-aux/ci/configure-wrapper $CONFIG_OPTS - name: Build run: | @@ -123,4 +123,4 @@ jobs: - name: Detailed error logs if: failure() - run: ./build-aux/ci-log-logfiles + run: ./build-aux/ci/ci-log-logfiles diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index fd9062c..c6d67e0 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -85,7 +85,7 @@ jobs: - name: Versions of build tools id: build-tools - run: ./build-aux/ci-log-dependency-versions + run: ./build-aux/ci/ci-log-dependency-versions - name: Get nprocs run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV @@ -156,4 +156,4 @@ jobs: - name: Detailed error logs if: failure() - run: ./build-aux/ci-log-logfiles + run: ./build-aux/ci/ci-log-logfiles diff --git a/.github/workflows/distcheck.yml b/.github/workflows/distcheck.yml index 9277ef1..7ae179d 100644 --- a/.github/workflows/distcheck.yml +++ b/.github/workflows/distcheck.yml @@ -60,7 +60,7 @@ jobs: - name: Versions of build tools id: build-tools - run: ./build-aux/ci-log-dependency-versions + run: ./build-aux/ci/ci-log-dependency-versions - name: Get nprocs run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV @@ -98,4 +98,4 @@ jobs: - name: Detailed error logs if: failure() - run: ./build-aux/ci-log-logfiles + run: ./build-aux/ci/ci-log-logfiles diff --git a/.github/workflows/memcheck.yml b/.github/workflows/memcheck.yml index c12db84..22dca33 100644 --- a/.github/workflows/memcheck.yml +++ b/.github/workflows/memcheck.yml @@ -45,7 +45,7 @@ jobs: - name: Versions of build tools id: build-tools - run: ./build-aux/ci-log-dependency-versions + run: ./build-aux/ci/ci-log-dependency-versions - name: Get nprocs run: echo "NPROCS=$((`nproc --all 2>/dev/null || sysctl -n hw.ncpu` * 2))" | tee $GITHUB_ENV @@ -74,7 +74,7 @@ jobs: run: ./autogen.sh - name: Configure - run: ./build-aux/configure-wrapper --enable-obsolete-api --enable-hashes=all --enable-valgrind-memcheck + run: ./build-aux/ci/configure-wrapper --enable-obsolete-api --enable-hashes=all --enable-valgrind-memcheck - name: Build run: | @@ -86,7 +86,7 @@ jobs: - name: Detailed error logs if: failure() - run: ./build-aux/ci-log-logfiles + run: ./build-aux/ci/ci-log-logfiles ASan-UBSan: needs: skip_duplicates @@ -114,7 +114,7 @@ jobs: - name: Versions of build tools id: build-tools - run: ./build-aux/ci-log-dependency-versions + run: ./build-aux/ci/ci-log-dependency-versions - name: Cache bootstrap id: cache @@ -140,7 +140,7 @@ jobs: run: ./autogen.sh - name: Configure - run: ./build-aux/configure-wrapper --enable-obsolete-api --enable-hashes=all + run: ./build-aux/ci/configure-wrapper --enable-obsolete-api --enable-hashes=all - name: Build run: | @@ -152,4 +152,4 @@ jobs: - name: Detailed error logs if: failure() - run: ./build-aux/ci-log-logfiles + run: ./build-aux/ci/ci-log-logfiles diff --git a/build-aux/ci-log-dependency-versions b/build-aux/ci-log-dependency-versions deleted file mode 100755 index ac9537f..0000000 --- a/build-aux/ci-log-dependency-versions +++ /dev/null @@ -1,79 +0,0 @@ -#! /bin/sh -set -e - -# Record certain build tool versions for use as a cache key. -autotools_ver= - -# Log the identities and versions of the build tools. -for tool in \ - "${CC-cc}" \ - "${NM-nm}" \ - "${AUTOCONF-autoconf}" \ - "${AUTOMAKE-automake}" \ - "${LIBTOOLIZE-libtoolize}" \ - "${PKG_CONFIG-pkg-config}" \ - "${PERL-perl}" \ - "${CPANM-cpanm}" \ - "${PERLCRITIC-perlcritic}" \ - "${PERLTIDY-perltidy}" \ - "${PYTHON-python3}" \ - "${GCOV-gcov}" \ - "${LCOV-lcov}" \ - "${LLVM_COV-llvm-cov}" \ - "${VALGRIND-valgrind}" -do - # $tool might include mandatory command-line arguments. - # Interpret it the same way Make would. - set fnord $tool; shift # word-split $tool and load it into "$@" - - echo ::group::"$1" - if command -V "$1"; then - echo + "$@" --version - "$@" --version - fi - echo ::endgroup:: - - case "$1" in - (*autoconf*) - autotools_ver="${autotools_ver}ac$("$@" --version 2>&1 | - sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}' - )" - ;; - - (*automake*) - autotools_ver="${autotools_ver}am$("$@" --version | - sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}' - )" - ;; - - (*libtoolize*) - autotools_ver="${autotools_ver}lt$("$@" --version | - sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}' - )" - ;; - - (*pkg-config*) - autotools_ver="${autotools_ver}pk$("$@" --version | - sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}' - )" - ;; - - (*python*) - echo ::group::passlib - "$@" -c ' -try: - import passlib - import os.path - print("passlib is " + os.path.dirname(passlib.__file__)) - print("passlib: version " + passlib.__version__) -except ModuleNotFoundError: - print("passlib is not installed") -' - echo ::endgroup:: - ;; - esac -done - -set fnord; shift # clear $@ -echo "::set-output name=autotools-ver::$autotools_ver" -exit 0 diff --git a/build-aux/ci-log-logfiles b/build-aux/ci-log-logfiles deleted file mode 100755 index 57633ab..0000000 --- a/build-aux/ci-log-logfiles +++ /dev/null @@ -1,16 +0,0 @@ -#! /bin/sh - -dump_log () { - if [ -s "$1" ]; then - echo "::group::$1" - echo '::stop-commands::resume-50YEO1zJ8HSXH4Zy' - cat "$1" - echo '::resume-50YEO1zJ8HSXH4Zy::' - echo '::endgroup::' - fi -} - -dump_log config.log -for ts in $(find . -name 'test-suite*.log' -printf '%P\n'); do - dump_log "$ts" -done diff --git a/build-aux/ci/ci-log-dependency-versions b/build-aux/ci/ci-log-dependency-versions new file mode 100755 index 0000000..ac9537f --- /dev/null +++ b/build-aux/ci/ci-log-dependency-versions @@ -0,0 +1,79 @@ +#! /bin/sh +set -e + +# Record certain build tool versions for use as a cache key. +autotools_ver= + +# Log the identities and versions of the build tools. +for tool in \ + "${CC-cc}" \ + "${NM-nm}" \ + "${AUTOCONF-autoconf}" \ + "${AUTOMAKE-automake}" \ + "${LIBTOOLIZE-libtoolize}" \ + "${PKG_CONFIG-pkg-config}" \ + "${PERL-perl}" \ + "${CPANM-cpanm}" \ + "${PERLCRITIC-perlcritic}" \ + "${PERLTIDY-perltidy}" \ + "${PYTHON-python3}" \ + "${GCOV-gcov}" \ + "${LCOV-lcov}" \ + "${LLVM_COV-llvm-cov}" \ + "${VALGRIND-valgrind}" +do + # $tool might include mandatory command-line arguments. + # Interpret it the same way Make would. + set fnord $tool; shift # word-split $tool and load it into "$@" + + echo ::group::"$1" + if command -V "$1"; then + echo + "$@" --version + "$@" --version + fi + echo ::endgroup:: + + case "$1" in + (*autoconf*) + autotools_ver="${autotools_ver}ac$("$@" --version 2>&1 | + sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}' + )" + ;; + + (*automake*) + autotools_ver="${autotools_ver}am$("$@" --version | + sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}' + )" + ;; + + (*libtoolize*) + autotools_ver="${autotools_ver}lt$("$@" --version | + sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}' + )" + ;; + + (*pkg-config*) + autotools_ver="${autotools_ver}pk$("$@" --version | + sed -Ene '1{s/^[^\(]+\([^\)]+\) //;p}' + )" + ;; + + (*python*) + echo ::group::passlib + "$@" -c ' +try: + import passlib + import os.path + print("passlib is " + os.path.dirname(passlib.__file__)) + print("passlib: version " + passlib.__version__) +except ModuleNotFoundError: + print("passlib is not installed") +' + echo ::endgroup:: + ;; + esac +done + +set fnord; shift # clear $@ +echo "::set-output name=autotools-ver::$autotools_ver" +exit 0 diff --git a/build-aux/ci/ci-log-logfiles b/build-aux/ci/ci-log-logfiles new file mode 100755 index 0000000..57633ab --- /dev/null +++ b/build-aux/ci/ci-log-logfiles @@ -0,0 +1,16 @@ +#! /bin/sh + +dump_log () { + if [ -s "$1" ]; then + echo "::group::$1" + echo '::stop-commands::resume-50YEO1zJ8HSXH4Zy' + cat "$1" + echo '::resume-50YEO1zJ8HSXH4Zy::' + echo '::endgroup::' + fi +} + +dump_log config.log +for ts in $(find . -name 'test-suite*.log' -printf '%P\n'); do + dump_log "$ts" +done diff --git a/build-aux/ci/clang-gcov-wrapper b/build-aux/ci/clang-gcov-wrapper new file mode 100755 index 0000000..3e9397f --- /dev/null +++ b/build-aux/ci/clang-gcov-wrapper @@ -0,0 +1,2 @@ +#! /bin/sh +exec llvm-cov gcov "$@" diff --git a/build-aux/ci/configure-wrapper b/build-aux/ci/configure-wrapper new file mode 100755 index 0000000..bfb06d2 --- /dev/null +++ b/build-aux/ci/configure-wrapper @@ -0,0 +1,10 @@ +#!/bin/bash + +export DEB_BUILD_MAINT_OPTIONS="${DEB_BUILD_MAINT_OPTIONS:-hardening=+all}" + +export CPPFLAGS="${CPPFLAGS} $(dpkg-buildflags --get CPPFLAGS)" +export CFLAGS="${CFLAGS} $(dpkg-buildflags --get CFLAGS)" +export CXXFLAGS="${CXXFLAGS} $(dpkg-buildflags --get CXXFLAGS)" +export LDFLAGS="${LDFLAGS} $(dpkg-buildflags --get LDFLAGS)" + +$PWD/configure "$@" diff --git a/build-aux/ci/summarize-coverage b/build-aux/ci/summarize-coverage new file mode 100755 index 0000000..0cfd4be --- /dev/null +++ b/build-aux/ci/summarize-coverage @@ -0,0 +1,24 @@ +#! /bin/sh +set -e + +case "$CC" in + (*clang*) + GCOV=$(pwd)/build-aux/ci/clang-gcov-wrapper ;; + (*) + GCOV=gcov ;; +esac + +unpruned=$(mktemp --tmpdir all-coverage.XXXXXXXXXX.info) +trap 'rm -f "'"$unpruned"'"' 0 + +set -x +# Merge all of the gcov output into one overview file using lcov, +# then prune data for the tests themselves, and for system libraries. + +lcov --gcov-tool "$GCOV" --rc lcov_branch_coverage=1 \ + --directory . --output-file "$unpruned" \ + --capture + +lcov --gcov-tool "$GCOV" --rc lcov_branch_coverage=1 \ + --directory . --output-file "$1" \ + --remove "$unpruned" '/usr/*' '*test*' diff --git a/build-aux/clang-gcov-wrapper b/build-aux/clang-gcov-wrapper deleted file mode 100755 index 3e9397f..0000000 --- a/build-aux/clang-gcov-wrapper +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh -exec llvm-cov gcov "$@" diff --git a/build-aux/configure-wrapper b/build-aux/configure-wrapper deleted file mode 100755 index bfb06d2..0000000 --- a/build-aux/configure-wrapper +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -export DEB_BUILD_MAINT_OPTIONS="${DEB_BUILD_MAINT_OPTIONS:-hardening=+all}" - -export CPPFLAGS="${CPPFLAGS} $(dpkg-buildflags --get CPPFLAGS)" -export CFLAGS="${CFLAGS} $(dpkg-buildflags --get CFLAGS)" -export CXXFLAGS="${CXXFLAGS} $(dpkg-buildflags --get CXXFLAGS)" -export LDFLAGS="${LDFLAGS} $(dpkg-buildflags --get LDFLAGS)" - -$PWD/configure "$@" diff --git a/build-aux/summarize-coverage b/build-aux/summarize-coverage deleted file mode 100755 index c5bfdf3..0000000 --- a/build-aux/summarize-coverage +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/sh -set -e - -case "$CC" in - (*clang*) - GCOV=$(pwd)/build-aux/clang-gcov-wrapper ;; - (*) - GCOV=gcov ;; -esac - -unpruned=$(mktemp --tmpdir all-coverage.XXXXXXXXXX.info) -trap 'rm -f "'"$unpruned"'"' 0 - -set -x -# Merge all of the gcov output into one overview file using lcov, -# then prune data for the tests themselves, and for system libraries. - -lcov --gcov-tool "$GCOV" --rc lcov_branch_coverage=1 \ - --directory . --output-file "$unpruned" \ - --capture - -lcov --gcov-tool "$GCOV" --rc lcov_branch_coverage=1 \ - --directory . --output-file "$1" \ - --remove "$unpruned" '/usr/*' '*test*' -- cgit v1.2.3