Skip to content

Commit a3f2eec

Browse files
dschogitster
authored andcommitted
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>
1 parent 5127e8c commit a3f2eec

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

ci/lib.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ save_good_tree () {
3434
# successfully before (e.g. because the branch got rebased, changing only
3535
# the commit messages).
3636
skip_good_tree () {
37-
if test "$TRAVIS_DEBUG_MODE" = true
37+
if test "$TRAVIS_DEBUG_MODE" = true || test true = "$GITHUB_ACTIONS"
3838
then
3939
return
4040
fi
@@ -136,6 +136,24 @@ then
136136
MAKEFLAGS="$MAKEFLAGS --jobs=10"
137137
test windows_nt != "$CI_OS_NAME" ||
138138
GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS"
139+
elif test true = "$GITHUB_ACTIONS"
140+
then
141+
CI_TYPE=github-actions
142+
CI_BRANCH="$GITHUB_REF"
143+
CI_COMMIT="$GITHUB_SHA"
144+
CI_OS_NAME="$(echo "$RUNNER_OS" | tr A-Z a-z)"
145+
test macos != "$CI_OS_NAME" || CI_OS_NAME=osx
146+
CI_REPO_SLUG="$GITHUB_REPOSITORY"
147+
CI_JOB_ID="$GITHUB_RUN_ID"
148+
CC="${CC:-gcc}"
149+
150+
cache_dir="$HOME/none"
151+
152+
export GIT_PROVE_OPTS="--timer --jobs 10"
153+
export GIT_TEST_OPTS="--verbose-log -x"
154+
MAKEFLAGS="$MAKEFLAGS --jobs=10"
155+
test windows != "$CI_OS_NAME" ||
156+
GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS"
139157
else
140158
echo "Could not identify CI type" >&2
141159
env >&2

0 commit comments

Comments
 (0)