Accelerate CI for Windows: reuse build directory, except in nightly runs
The Windows section of .gitlab-ci.yml contains conditional code like
- if($CI_PIPELINE_SOURCE -eq "schedule") { mkdir -Force $BUILD_DIR; echo "scheduled build" }
- if(!(Test-Path -path $BUILD_DIR)) { mkdir -Force $BUILD_DIR; echo "build from scratch" }
that is meant to preserve the build directory unless it is a scheduled (nightly) run.
However, this code will only become effective when the following outcommented lines are restored
# cache:
# key: build-cache
# paths:
# - build/
If this is done, then we get a few errors like the following:
37/907 Test #830: PyEmbedded.FunctionCall .........................................................***Failed 0.62 sec
Note: Google Test filter = PyEmbedded.FunctionCall
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from PyEmbedded
[ RUN ] PyEmbedded.FunctionCall
Traceback (most recent call last):
File "C:\GitLab-Runner/builds/goVWmES9/0/mlz/bornagain/build/lib\bornagain\__init__.py", line 14, in <module>
from libBornAgainBase import *
File "C:\GitLab-Runner/builds/goVWmES9/0/mlz/bornagain/build/lib\libBornAgainBase.py", line 2033, in <module>
class RotMatrix(object):
File "C:\GitLab-Runner/builds/goVWmES9/0/mlz/bornagain/build/lib\libBornAgainBase.py", line 2045, in RotMatrix
EULER = _libBornAgainBase.RotMatrix_EULER
AttributeError: module '_libBornAgainBase' has no attribute 'RotMatrix_EULER'
unknown file: error: C++ exception with description "Can't load bornagain" thrown in the test body.
[ FAILED ] PyEmbedded.FunctionCall (512 ms)
It is unclear to me how these errors can be caused by caching the build directory.