Skip to content

Commit 04c1f2e

Browse files
committed
CI: avoid useless git costs
* .travis.yml (git.depth): Make the clone very shallow. (git.submodules): Don't clone gnulib in test jobs. (jobs.include.compile.script): Do it here.
1 parent 49aae94 commit 04c1f2e

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

.travis.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Travis defines and exports CC and CXX *after* we have defined our
2-
# environment variables via 'env'. So, do not use 'env' to define
3-
# them. Instead, put their definitions in MATRIX_EVAL, which we eval
4-
# after the definitions from Travis.
5-
2+
# environment variables via 'env'. So, do not use 'env' to define them.
3+
# Instead, put their definitions in MATRIX_EVAL, which we eval after the
4+
# definitions from Travis.
65
language: cpp
76

87
env:
@@ -21,7 +20,17 @@ stages:
2120
- compile
2221
- test
2322

24-
# matrix.include and jobs.include are aliases (https://docs.travis-ci.com/user/conditional-builds-stages-jobs/).
23+
git:
24+
# Manually handle git submodules so that we don't have to uselessly waste 3
25+
# minutes to download gnulib in the 'test' jobs.
26+
submodules: false
27+
28+
# For the same reasons, we would like to not clone the repo either, but it
29+
# does not seem to be possible.
30+
depth: 1
31+
32+
# matrix.include and jobs.include are aliases
33+
# (https://docs.travis-ci.com/user/conditional-builds-stages-jobs/).
2534
jobs:
2635
include:
2736
- stage: "compile"
@@ -37,16 +46,10 @@ jobs:
3746
- help2man --version
3847
- makeinfo --version
3948
- m4 --version
40-
- git tag -l
41-
# For some reasons, sometimes the checkout does not have any tags,
42-
# so `git describe` fails, so bootstrap fails.
43-
- git describe || git tag v3.0 -m "Fake version 3.0."
44-
- git describe
45-
46-
# Appears to be needed for the following command (https://github.com/AppImage/AppImageKit/issues/511).
47-
- git submodule sync
49+
4850
# Travis makes a shallow clone, but we need it in full to build the ChangeLog and apply the fixes in git-log-fix.
4951
- git fetch --unshallow || true
52+
- git submodule update --init --recursive
5053

5154
- ./bootstrap
5255
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi

0 commit comments

Comments
 (0)