diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-01-15 08:46:11 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-01-15 14:00:18 -0500 |
commit | 3c42d43c516d98065a8b62b080eb278c7526c7d9 (patch) | |
tree | 77ec2ff99e9bd0cf51ef32ab48512341bfb2d68a | |
parent | 5e5ed6131ac202cbc563fefefb0f114fa6465a54 (diff) | |
download | haskell-wip/submod-linter.tar.gz |
gitlab-ci: Allow submodule cleaning to fail on Windowswip/submod-linter
Currently CI is inexplicably failing with
```
$ git submodule foreach git clean -xdf
fatal: not a git repository: libffi-tarballs/../.git/modules/libffi-tarballs
```
I have no idea how this working tree got into such a state but we do
need to fail more gracefully when it happens. Consequently, we allow the
cleaning step to fail.
-rw-r--r-- | .gitlab-ci.yml | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 34c441b1c3..cbe0bb1651 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -769,7 +769,6 @@ validate-x86_64-linux-fedora27: <<: *only-default before_script: - git clean -xdf - - git submodule foreach git clean -xdf # Use a local temporary directory to ensure that concurrent builds don't # interfere with one another @@ -779,8 +778,13 @@ validate-x86_64-linux-fedora27: set TEMP=%cd%\tmp - set PATH=C:\msys64\usr\bin;%PATH% - - git submodule sync --recursive - - git submodule update --init --recursive + # On Windows submodules can inexplicably get into funky states where git + # believes that the submodule is initialized yet its associated repository + # is not valid. Avoid failing in this case with the following insanity. + - | + bash -c 'git submodule sync --recursive || git submodule deinit --force --all' + bash -c 'git submodule update --init --recursive' + git submodule foreach git clean -xdf - git checkout .gitmodules - "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true" - bash .gitlab/win32-init.sh |