@matheusbsbs / matheus-bagliano / commits / a3f2eec862
Fork 0

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>

Johannes Schindelin committed Apr 8, 2020 at 11:05 UTC a3f2eec862b6f075e7012b079effa8f355dffa87
1 file changed +19 -1
ci/lib.sh
+19 -1
@@ -34,7 +34,7 @@ save_good_tree () {
34 # successfully before (e.g. because the branch got rebased, changing only
35 # the commit messages).
36 skip_good_tree () {
37 - if test "$TRAVIS_DEBUG_MODE" = true
37 + if test "$TRAVIS_DEBUG_MODE" = true || test true = "$GITHUB_ACTIONS"
38 then
39 return
40 fi
@@ -136,6 +136,24 @@ then
136 MAKEFLAGS="$MAKEFLAGS --jobs=10"
137 test windows_nt != "$CI_OS_NAME" ||
138 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"
157 else
158 echo "Could not identify CI type" >&2
159 env >&2