summaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-04-08 04:05:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-04-08 05:17:10 (GMT)
commita3f2eec862b6f075e7012b079effa8f355dffa87 (patch)
tree2b257a4e0e29aa22f0e3be4b7fe267ee3c6e2f75 /ci
parent5127e8cf7aa78906959d71150200860b4c7e491a (diff)
downloadgit-a3f2eec862b6f075e7012b079effa8f355dffa87.zip
git-a3f2eec862b6f075e7012b079effa8f355dffa87.tar.gz
git-a3f2eec862b6f075e7012b079effa8f355dffa87.tar.bz2
ci/lib: allow running in GitHub Actions
For each CI system we support, we need a specific arm in that if/else construct in ci/lib.sh. Let's add one for GitHub Actions. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/lib.sh20
1 files changed, 19 insertions, 1 deletions
diff --git a/ci/lib.sh b/ci/lib.sh
index bda746d..f92e3a5 100755
--- 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
@@ -136,6 +136,24 @@ 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"
else
echo "Could not identify CI type" >&2
env >&2