]> git.ipfire.org Git - thirdparty/git.git/blobdiff - ci/lib.sh
Merge branch 'jc/codingstyle-compare-with-null'
[thirdparty/git.git] / ci / lib.sh
index c3a8cd2104641e8134f8af04dd4ac6bc4a841209..dac36886e3744fba251506be53d48034adcecd17 100755 (executable)
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -34,7 +34,7 @@ save_good_tree () {
 # successfully before (e.g. because the branch got rebased, changing only
 # the commit messages).
 skip_good_tree () {
-       if test "$TRAVIS_DEBUG_MODE" = true
+       if test "$TRAVIS_DEBUG_MODE" = true || test true = "$GITHUB_ACTIONS"
        then
                return
        fi
@@ -79,6 +79,9 @@ check_unignored_build_artifacts ()
        }
 }
 
+# GitHub Action doesn't set TERM, which is required by tput
+export TERM=${TERM:-dumb}
+
 # Clear MAKEFLAGS that may come from the outside world.
 export MAKEFLAGS=
 
@@ -136,8 +139,32 @@ then
        MAKEFLAGS="$MAKEFLAGS --jobs=10"
        test windows_nt != "$CI_OS_NAME" ||
        GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS"
+elif test true = "$GITHUB_ACTIONS"
+then
+       CI_TYPE=github-actions
+       CI_BRANCH="$GITHUB_REF"
+       CI_COMMIT="$GITHUB_SHA"
+       CI_OS_NAME="$(echo "$RUNNER_OS" | tr A-Z a-z)"
+       test macos != "$CI_OS_NAME" || CI_OS_NAME=osx
+       CI_REPO_SLUG="$GITHUB_REPOSITORY"
+       CI_JOB_ID="$GITHUB_RUN_ID"
+       CC="${CC:-gcc}"
+
+       cache_dir="$HOME/none"
+
+       export GIT_PROVE_OPTS="--timer --jobs 10"
+       export GIT_TEST_OPTS="--verbose-log -x"
+       MAKEFLAGS="$MAKEFLAGS --jobs=10"
+       test windows != "$CI_OS_NAME" ||
+       GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS"
+
+       # https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers
+       echo "::add-matcher::ci/git-problem-matcher.json"
+       test linux-musl = "$jobname" ||
+       MAKEFLAGS="$MAKEFLAGS TEST_SHELL_PATH=/bin/sh"
 else
        echo "Could not identify CI type" >&2
+       env >&2
        exit 1
 fi
 
@@ -195,9 +222,17 @@ osx-clang|osx-gcc)
        # Travis CI OS X
        export GIT_SKIP_TESTS="t9810 t9816"
        ;;
-GIT_TEST_GETTEXT_POISON)
+GETTEXT_POISON)
        export GIT_TEST_GETTEXT_POISON=true
        ;;
+Linux32)
+       CC=gcc
+       ;;
+linux-musl)
+       CC=gcc
+       MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python3 USE_LIBPCRE2=Yes"
+       MAKEFLAGS="$MAKEFLAGS NO_REGEX=Yes ICONV_OMITS_BOM=Yes"
+       ;;
 esac
 
 MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}"