git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 01/10] CI: run "set -ex" early in ci/lib.sh

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 14, 2022, 19:39 UTC
Message-ID
<patch-01.10-905a9419267-20220714T193808Z-avarab@gmail.com>
In-Reply-To
<cover-00.10-00000000000-20220714T193808Z-avarab@gmail.com>

Change ci/lib.sh to run "set -e" before it does anything else, this help us to assert that we have no failing commands early on in the file.

While we're at it let's fix a stray typo in ecaba2ad4c0 (ci/run-build-and-tests: add some structure to the GitHub workflow output, 2022-05-21), which seemingly added "#" to the middle of a line while re-wrapping a comment.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 ci/lib.sh | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/ci/lib.sh b/ci/lib.sh
index f095519f8db..4f12bcaabb9 100755
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -1,5 +1,13 @@
 # Library of functions shared by all CI scripts
 
+# Set 'exit on error' for all CI scripts to let the caller know that
+# something went wrong.
+#
+# We'll enable "set -x" below for tracing executed commands, that will
+# help to show how environment variables are set and and dependencies
+# are installed.
+set -e
+
 if test true != "$GITHUB_ACTIONS"
 then
 	begin_group () { :; }
@@ -44,13 +52,6 @@ else
 	begin_group "CI setup"
 fi
 
-# Set 'exit on error' for all CI scripts to let the caller know that
-# something went wrong.
-#
-# We already enabled tracing executed commands earlier. This helps by showing
-# how # environment variables are set and and dependencies are installed.
-set -e
-
 skip_branch_tip_with_tag () {
 	# Sometimes, a branch is pushed at the same time the tag that points
 	# at the same commit as the tip of the branch is pushed, and building
-- 
2.37.1.996.g651fc6e809f
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 2 of 11 in “ci: make it easy to run locally, part 1”
  1. 00/10 ci: make it easy to run locally, part 1Ævar Arnfjörð Bjarmason, Jul 14, 2022
  2. 01/10 CI: run "set -ex" early in ci/lib.shÆvar Arnfjörð Bjarmason, Jul 14, 2022
  3. 02/10 CI: remove more dead Travis CI supportÆvar Arnfjörð Bjarmason, Jul 14, 2022
  4. 03/10 CI: remove dead "tree skipping" codeÆvar Arnfjörð Bjarmason, Jul 14, 2022
  5. 04/10 CI: make "$jobname" explicit, remove fallbackÆvar Arnfjörð Bjarmason, Jul 14, 2022
  6. 05/10 CI/lib.sh: stop adding leading whitespace to $MAKEFLAGSÆvar Arnfjörð Bjarmason, Jul 14, 2022
  7. 06/10 CI: consistently use "export" in ci/lib.shÆvar Arnfjörð Bjarmason, Jul 14, 2022
  8. 07/10 CI: export variables via a wrapperÆvar Arnfjörð Bjarmason, Jul 14, 2022
  9. 08/10 CI: don't have "git grep" invoke a pager in tree content checkÆvar Arnfjörð Bjarmason, Jul 14, 2022
  10. 10/10 CI: have "static-analysis" run "check-builtins", not "documentation"Ævar Arnfjörð Bjarmason, Jul 14, 2022
  11. 09/10 CI: have "static-analysis" run a "make ci-static-analysis" targetÆvar Arnfjörð Bjarmason, Jul 14, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.