diff options
author | Zack Weinberg <zackw@panix.com> | 2021-07-22 11:07:06 -0400 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2021-07-22 11:07:06 -0400 |
commit | 66d8342f80155202030ebf2974e2dcba4e297baf (patch) | |
tree | 161a2c7c61222bc1ed1dfbdd0f11834c086520c7 | |
parent | 3aa82ccd3a3fecea7e6a9d0f9c85c56e2e04bb78 (diff) | |
download | libxcrypt-66d8342f80155202030ebf2974e2dcba4e297baf.tar.gz libxcrypt-66d8342f80155202030ebf2974e2dcba4e297baf.tar.bz2 libxcrypt-66d8342f80155202030ebf2974e2dcba4e297baf.zip |
CI: Bootstrap caching and better log dumping for codecov.yml.
Use the ‘cache’ action to save all the files created by autogen.sh,
keyed on a hash of the autotools source files, plus the version
numbers of autoconf, automake, libtool, and pkg-config. This shaves a
few seconds off all our builds, and since we’re about to go from ten
builds to more than 50, it’s worth it.
Move log dumping on test failure to an independent script that
captures config.log as well as all testsuite logs no matter where they
are found. Use “action commands” to make nice foldable sections for
each. Also add foldable sections to the output of
ci-log-dependency-versions.
-rw-r--r-- | .github/workflows/codecov.yml | 48 | ||||
-rwxr-xr-x | build-aux/ci-log-dependency-versions | 42 | ||||
-rwxr-xr-x | build-aux/ci-log-logfiles | 16 |
3 files changed, 98 insertions, 8 deletions
diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index b89f0a2..6f4317a 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,4 +1,4 @@ -name: Codecov +name: "Code coverage" on: pull_request: @@ -6,7 +6,7 @@ on: jobs: skip_duplicates: - # continue-on-error: true # Uncomment once integration is finished + continue-on-error: true runs-on: ubuntu-latest outputs: should_skip: ${{ steps.skip_check.outputs.should_skip }} @@ -63,21 +63,59 @@ jobs: packages="$packages clang llvm" fi sudo apt-get install $packages + - name: Versions of build tools + id: build-tools run: ./build-aux/ci-log-dependency-versions + + - name: Cache bootstrap + id: cache + uses: actions/cache@v2 + with: + path: | + INSTALL + Makefile.in + aclocal.m4 + config.h.in + configure + autom4te.cache/** + build-aux/compile + build-aux/config.guess + build-aux/config.sub + build-aux/depcomp + build-aux/install-sh + build-aux/libtool.m4 + build-aux/ltmain.sh + build-aux/ltoptions.m4 + build-aux/ltsugar.m4 + build-aux/ltversion.m4 + build-aux/lt~obsolete.m4 + build-aux/missing + build-aux/test-driver + key: autoreconf-${{ steps.build-tools.outputs.autotools-ver }}-${{ hashFiles('autogen.sh', 'configure.ac', 'Makefile.am', 'build-aux/*.m4') }} + - name: Bootstrap + if: steps.cache.outputs.cache-hit != 'true' run: ./autogen.sh + - name: Configure run: ./configure $CONFIG_OPTS + - name: Build - run: make + run: make all test-programs + - name: Test - run: make check || (cat test-suite.log; exit 1) + run: make check + - name: Summarize coverage data run: ./build-aux/summarize-coverage coverage.info + - name: Upload coverage data to Codecov uses: codecov/codecov-action@v2 with: fail_ci_if_error: true - verbose: true files: coverage.info + + - name: Detailed error logs + if: failure() + run: ./build-aux/ci-log-logfiles diff --git a/build-aux/ci-log-dependency-versions b/build-aux/ci-log-dependency-versions index c67d2c0..ac9537f 100755 --- a/build-aux/ci-log-dependency-versions +++ b/build-aux/ci-log-dependency-versions @@ -1,6 +1,9 @@ #! /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}" \ @@ -16,18 +19,47 @@ for tool in \ "${PYTHON-python3}" \ "${GCOV-gcov}" \ "${LCOV-lcov}" \ - "${LLVM_COV-llvm-cov}" + "${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 + 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 @@ -35,9 +67,13 @@ try: print("passlib is " + os.path.dirname(passlib.__file__)) print("passlib: version " + passlib.__version__) except ModuleNotFoundError: - print("passlib is not installed\n") + 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 new file mode 100755 index 0000000..57633ab --- /dev/null +++ b/build-aux/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 |