From: Francesco Chemolli <5175948+kinkie@users.noreply.github.com> Date: Sun, 16 Feb 2025 23:46:20 +0000 (+0000) Subject: CI: show build commands on terminal (#1965) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5a66fc26d;p=thirdparty%2Fsquid.git CI: show build commands on terminal (#1965) test-builds.sh records build output in per-layer logs, and we are already collecting those logs. Send build output to standard output as well, to expose it in GitHub Actions user interface. This new detailed output is enclosed in a "layer ... output" group to keep emphasizing problematic output lines extracted by test-builds.sh. Also enclose MacOS build setup output in a group, for similar reasons. --- diff --git a/.github/workflows/quick.yaml b/.github/workflows/quick.yaml index 2383244752..1229b8ac02 100644 --- a/.github/workflows/quick.yaml +++ b/.github/workflows/quick.yaml @@ -148,7 +148,7 @@ jobs: key: ${{ matrix.os }}-${{ matrix.compiler.CC }}-${{ matrix.layer.nick }} - name: Run build on Linux - run: ./test-builds.sh ${{ matrix.layer.name }} + run: ./test-builds.sh --verbose ${{ matrix.layer.name }} - name: Publish build logs if: success() || failure() @@ -181,7 +181,7 @@ jobs: uses: github/codeql-action/init@v3 - name: Build Squid - run: ./test-builds.sh ./test-suite/buildtests/layer-02-maximus.opts + run: ./test-builds.sh --verbose ./test-suite/buildtests/layer-02-maximus.opts - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/slow.yaml b/.github/workflows/slow.yaml index 4b72314050..20334bdc9e 100644 --- a/.github/workflows/slow.yaml +++ b/.github/workflows/slow.yaml @@ -72,8 +72,7 @@ jobs: - name: Run test-builds id: test-builds - run: | - ./test-builds.sh ${{ matrix.layer.name }} + run: ./test-builds.sh --verbose ${{ matrix.layer.name }} - name: Publish build logs if: success() || failure() @@ -101,6 +100,7 @@ jobs: - name: Run test-builds id: test-builds run: | + echo "::group::setup output" eval `brew shellenv` PKG_CONFIG_PATH="$HOMEBREW_PREFIX/lib/pkgconfig" PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOMEBREW_PREFIX/opt/openldap/lib/pkgconfig" @@ -128,8 +128,9 @@ jobs: editable=$HOMEBREW_CELLAR/libtool/2.4.7/bin/glibtoolize sed -i.bak 's@ltdl_ac_aux_dir=""@ltdl_ac_aux_dir="../build-aux"@' $editable || true diff -u $editable.bak $editable || true + echo "::endgroup::" - ./test-builds.sh + ./test-builds.sh --verbose - name: Publish build logs if: success() || failure() @@ -176,7 +177,7 @@ jobs: run: | export MAKE=gmake - ./test-builds.sh + ./test-builds.sh --verbose - name: Publish build logs if: success() || failure() diff --git a/test-builds.sh b/test-builds.sh index 7f27977cb3..2e42652dc8 100755 --- a/test-builds.sh +++ b/test-builds.sh @@ -68,9 +68,12 @@ while [ $# -ge 1 ]; do done logtee() { + local layer=$2 case $verbose in yes) + echo "::group::$layer output" # github collapsible section tee $1 + echo "::endgroup::" ;; progress) tee $1 | awk '{printf "."; n++; if (!(n % 80)) print "" } END {print ""}' @@ -111,7 +114,7 @@ buildtest() { # log the result for the outer script to notice echo "buildtest.sh result is $result"; - } 2>&1 | logtee ${log} + } 2>&1 | logtee ${log} ${layer} result=1 # failure by default if grep -q '^buildtest.sh result is 0$' ${log}; then