Skip to content

Commit b901307

Browse files
avargitster
authored andcommitted
CI: make "$jobname" explicit, remove fallback
Remove the $jobname fallback last adjusted in b011fab (ci/lib.sh: encapsulate Travis-specific things, 2019-01-27). This makes all of our CI jobs have an explicit $jobname, and removes the special-case of the Windows jobs implicitly setting one (that they don't currently use). In subsequent commits we'll use this new $jobname explicitly. This is a follow-up to my 2571541 (CI: don't run "make test" twice in one job, 2021-11-23), since then all the jobs except the Windows jobs have had an explicit $jobname. In the case of the Windows jobs we were using a jobname of windows-gcc for both, due to picking "gcc" as a default fallback for "$CC" in ci/lib.sh. Since we'll need this to run ci/lib.sh it makes sense to move the check to the top of the file. Subsequent commits will add more such assertions to it. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 9071f9e commit b901307

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ jobs:
7979
8080
windows-build:
8181
name: win build
82+
env:
83+
jobname: windows-build
8284
needs: ci-config
8385
if: needs.ci-config.outputs.enabled == 'yes'
8486
runs-on: windows-latest
@@ -100,6 +102,8 @@ jobs:
100102
path: artifacts
101103
windows-test:
102104
name: win test
105+
env:
106+
jobname: windows-test
103107
runs-on: windows-latest
104108
needs: [windows-build]
105109
strategy:
@@ -131,6 +135,8 @@ jobs:
131135
path: ${{env.FAILED_TEST_ARTIFACTS}}
132136
vs-build:
133137
name: win+VS build
138+
env:
139+
jobname: vs-build
134140
needs: ci-config
135141
if: needs.ci-config.outputs.enabled == 'yes'
136142
env:
@@ -183,6 +189,8 @@ jobs:
183189
path: artifacts
184190
vs-test:
185191
name: win+VS test
192+
env:
193+
jobname: vs-test
186194
runs-on: windows-latest
187195
needs: vs-build
188196
strategy:

ci/lib.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
# and installing dependencies.
77
set -ex
88

9+
# Starting assertions
10+
if test -z "$jobname"
11+
then
12+
echo "must set a CI jobname" >&2
13+
exit 1
14+
fi
15+
916
skip_branch_tip_with_tag () {
1017
# Sometimes, a branch is pushed at the same time the tag that points
1118
# at the same commit as the tip of the branch is pushed, and building
@@ -146,11 +153,6 @@ test -n "${DONT_SKIP_TAGS-}" ||
146153
skip_branch_tip_with_tag
147154
skip_good_tree
148155

149-
if test -z "$jobname"
150-
then
151-
jobname="$CI_OS_NAME-$CC"
152-
fi
153-
154156
export DEVELOPER=1
155157
export DEFAULT_TEST_TARGET=prove
156158
export GIT_TEST_CLONE_2GB=true

0 commit comments

Comments
 (0)