Skip to content

Commit 1e49f5e

Browse files
committed
CI: avoid useless git costs
The final gain is small: 2h2min instead 2h9min. But that is still an improvement. * .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 1e49f5e

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

.travis.yml

Lines changed: 16 additions & 14 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 submodules so that we don't have to uselessly waste 150s
25+
# 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,19 +46,12 @@ 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
52-
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
5355
- ./configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
5456
- make -j2
5557
- make -j2 dist

0 commit comments

Comments
 (0)