Skip to content

Commit

Permalink
CI: avoid useless git costs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
akimd committed May 19, 2019
1 parent 49aae94 commit 1e49f5e
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Travis defines and exports CC and CXX *after* we have defined our
# environment variables via 'env'. So, do not use 'env' to define
# them. Instead, put their definitions in MATRIX_EVAL, which we eval
# after the definitions from Travis.

# environment variables via 'env'. So, do not use 'env' to define them.
# Instead, put their definitions in MATRIX_EVAL, which we eval after the
# definitions from Travis.
language: cpp

env:
Expand All @@ -21,7 +20,17 @@ stages:
- compile
- test

# matrix.include and jobs.include are aliases (https://docs.travis-ci.com/user/conditional-builds-stages-jobs/).
git:
# Manually handle submodules so that we don't have to uselessly waste 150s
# to download gnulib in the 'test' jobs.
submodules: false

# For the same reasons, we would like to not clone the repo either, but it
# does not seem to be possible.
depth: 1

# matrix.include and jobs.include are aliases
# (https://docs.travis-ci.com/user/conditional-builds-stages-jobs/).
jobs:
include:
- stage: "compile"
Expand All @@ -37,19 +46,12 @@ jobs:
- help2man --version
- makeinfo --version
- m4 --version
- git tag -l
# For some reasons, sometimes the checkout does not have any tags,
# so `git describe` fails, so bootstrap fails.
- git describe || git tag v3.0 -m "Fake version 3.0."
- git describe

# Appears to be needed for the following command (https://github.com/AppImage/AppImageKit/issues/511).
- git submodule sync

# Travis makes a shallow clone, but we need it in full to build the ChangeLog and apply the fixes in git-log-fix.
- git fetch --unshallow || true
- git submodule update --init --recursive

- ./bootstrap
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
- ./configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
- make -j2
- make -j2 dist
Expand Down

0 comments on commit 1e49f5e

Please sign in to comment.