Commit 2e01908
CI: remove "run-build-and-tests.sh", run "make [test]" directly
Remove the already thin "ci/run-build-and-tests.sh" wrapper and
instead make the CI run "make" or "make test" directly. By doing this
we'll be able to easily see at a glance whether our failure was in the
compilation or testing, whether that's via human eyes or improve
machine readability.
We also need to run our new "ci/check-unignored-build-artifacts.sh" on
success() in the CI now, just like we already had a step conditional
on failure() running ci/print-test-failures.sh.
The reason we used a "ci/run-build-and-tests.sh" wrapper in the first
place had to do with Travis CI-specific constraints that no longer
apply to us, as the Travis CI support has been removed.
Instead we can configure the CI in an earlier step by running
"ci/lib.sh", which under GitHub CI will write the environment
variables we need to the "$GITHUB_ENV" file.
We'll then have access to them in subsequent steps, and crucially
those variables will be prominently visible at the start of each step
via an expandable drop-down in the UI.drop-do.
I.e. this changes the CI run from a top-down flow like (pseudocode):
- job:
- step1:
- use ci/lib.sh to set env vars
- run a script like ci/run-build-and-tests.sh
- step2:
- if: failure()
- use ci/lib.sh to set env vars
- run ci/print-test-failures.sh
To:
- job:
- step1:
- set variables in $GITHUB_ENV using ci/lib.sh
- step2:
- make
- step3:
- make test
- step4:
- if: failure()
- run ci/print-test-failures.sh
- step5:
- if: success()
- run ci/check-unignored-build-artifacts.sh
There is a proposal[2] to get some of the benefits of this approach by
not re-arranging our variable setup in this way, but to instead use
the GitHub CI grouping syntax to focus on the relevant parts of "make"
or "make test" when we have failures.
Doing it this way makes for better looking GitHub CI UI, and lays much
better ground work for our CI going forward. Because:
* The CI logic will be more portable to a future CI system, since a
common feature of them is to run various commands in sequence, but
a future system won't necessarily support the GitHub-specifics
syntax of "grouping" output within a "step".
Even if those systems don't support a "$GITHUB_ENV" emulating will
be much easier than to deal with some CI-specific grouping syntax.
* At the start of every step the GitHub CI presents an expandable
list of environment variables from "$GITHUB_ENV". We'll now see
exactly what variables affected that step (although we currently
overshoot that a bit, and always define all variables).
* CI failures will be easier to reproduce locally, as this makes the
relevant ci/* scripts something that sets up our environment, but
leaves "make" and "make test" working as they do locally.
To reproduce a run the user only needs to set the variables
discussed in the drop-down above, either manually or by running
"ci/lib.sh".
* The output will be less verbose. The "ci/lib.sh" script uses "set
-x", and before this e.g. "ci/static-analysis.sh" would start with
40 lines of trace output, culminating in using "export" to export
the relevant environment variables.
Now that verbosity is in the earlier "ci/lib.sh" step, and not in
any subsequent one. The "make" targets then start out with the
relevant output non-trace output right away.
* If we do want to use the grouping syntax within a "step" it'll now
be easier to do so. It doesn't support nesting, so we'd have to
make a choice between using it for e.g. "make" v.s. "make test", or
individual test failures. See "sadly" in [3].
1. https://lore.kernel.org/git/211120.86k0h30zuw.gmgdl@evledraar.gmail.com/
2. https://lore.kernel.org/git/pull.1117.git.1643050574.gitgitgadget@gmail.com/
3. https://lore.kernel.org/git/9333ba781b8240f704e739b00d274f8c3d887e39.1643050574.git.gitgitgadget@gmail.com/
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 04c9ad6 commit 2e01908
File tree
8 files changed
+62
-56
lines changed- .github/workflows
- ci
8 files changed
+62
-56
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
272 | 275 | | |
273 | 276 | | |
274 | 277 | | |
| |||
292 | 295 | | |
293 | 296 | | |
294 | 297 | | |
| 298 | + | |
295 | 299 | | |
296 | 300 | | |
297 | 301 | | |
298 | 302 | | |
299 | 303 | | |
300 | 304 | | |
301 | 305 | | |
302 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
303 | 310 | | |
304 | | - | |
| 311 | + | |
305 | 312 | | |
306 | 313 | | |
307 | 314 | | |
| |||
317 | 324 | | |
318 | 325 | | |
319 | 326 | | |
| 327 | + | |
320 | 328 | | |
321 | 329 | | |
322 | 330 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
| |||
96 | 105 | | |
97 | 106 | | |
98 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
99 | 137 | | |
100 | 138 | | |
101 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
0 commit comments