Commit cf8e45a
committed
github actions: Optimize kernel tree clone/fetch
Cloning the base branch takes a long time because a fetch-depth of 0 causes
all history for all branches and tags to be cloned (!). In addition, the
entire history of the PR branch is fetched.
Only the tip of the base branch along with the new commits present in a PR
need to be cloned; anything more than that is unneeded.
Reduce the depth of the base branch clone to 1 commit and the PR branch
fetch to the number of commits in the PR plus 1 (to get the tip of the base
branch).
The same philosophy is applied to fetching the mainline branch, which is
substantially more complex. All that is needed _at most_ is the history
between the kernel version tag and the tip of mainline, since the kernel
version tag is the most recent common ancestor between us and mainline.
History older than the kernel version tag is thus excluded via
--shallow-exclude.
And as an added bonus, skip checkout on the base branch clone since all of
the python scripts inspecting the tree perform checkouts themselves. That
way, no time is wasted on checking out the tree to a different SHA than the
first checkout by one of the python scripts.1 parent 9895ab4 commit cf8e45a
1 file changed
+23
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
35 | 51 | | |
36 | 52 | | |
37 | 53 | | |
| |||
55 | 71 | | |
56 | 72 | | |
57 | 73 | | |
| 74 | + | |
58 | 75 | | |
59 | 76 | | |
60 | 77 | | |
| |||
0 commit comments