Commit b98f15e
committed
Get tags for tests from original repo as fallback
This extends the init script so it tries harder to get version
tags:
- As before, locally, "git fetch --all --tags" is always run. (This
also fetches other objects, and the developer experience would be
undesirably inconsistent if that were only sometimes done.)
- On CI, run it if version tags are absent. The criterion followed
here and in subsequent steps is that if any existing tag starts
with a digit, or with the letter v followed by a digit, we regard
version tags to be present. This is to balance the benefit of
getting the tags (to make the tests work) against the risk of
creating a very confusing situation in clones of forks that
publish packages or otherwise use their own separate versioning
scheme (especially if those tags later ended up being pushed).
- Both locally and on CI, after that, if version tags are absent,
try to copy them from the original gitpython-developers/GitPython
repo, without copying other tags or adding that repo as a remote.
Copy only tags that start with a digit, since v+digit tags aren't
currently used in this project (though forks may use them). This
is a fallback option and it always displays a warning. If it
fails, another message is issued for that. Unexpected failure to
access the repo terminates the script with a failing exit status,
but the absence of version tags in the fallback remote does not,
so CI jobs can continue and reveal which tests fail as a result.
On GitHub Actions CI specifically, the Actions syntax for creating
a warning annotation on the workflow is used, but the warning is
still also written to stderr (as otherwise). GHA workflow
annotations don't support multi-line warnings, so the message is
adjusted into a single line where needed.1 parent fc96980 commit b98f15e
1 file changed
+34
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
10 | 24 | | |
11 | 25 | | |
12 | 26 | | |
| |||
33 | 47 | | |
34 | 48 | | |
35 | 49 | | |
36 | | - | |
| 50 | + | |
37 | 51 | | |
38 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
39 | 58 | | |
| 59 | + | |
40 | 60 | | |
41 | | - | |
42 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
43 | 73 | | |
0 commit comments