[hardening] github workflows - corrupted cache
aka: ensure that 'make test' works as expected
The cache contains a copy './local' which is - under some circumstance -
corrupted. It is not possible to clear the cache [1] (see the top of the page).
Ensure that 'make test' works as expected [2] even if
- the python interpreter is missing
- the virtualenv exists but pyyaml is missing
To hardening when the workflow cache fails, this patch adds the new target
'travis.test' into the workflow. This target probes to import a python module
'yaml'. If this fails the virtualenv will be completely new build.
[1] https://github.com/actions/cache/issues/2#issuecomment-673493515
[2] https://github.com/searx/searx/pull/2517#discussion_r567240235
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
commit8c45f1149dd464317c8a11829b084f2d30037162
authorMarkus Heiser <markus.heiser@darmarit.de>
dateMon 1 Feb 2021, 15:23 (6 years ago)
parent38b39ef
.github/workflows/integration.yml+1−1
@@ -34,7 +34,7 @@ jobs:
3434 make V=1 install
3535 make V=1 gecko.driver
3636 - name: Run tests
37− run: make V=1 test
37+ run: make V=1 ci.test
3838 - name: Test coverage
3939 run: make V=1 test.coverage
4040 - name: Store coverage result
Makefile+5
@@ -251,6 +251,11 @@ test.clean:
251251# travis
252252# ------
253253
254+PHONY += ci.test
255+ci.test:
256+ $(PY_ENV_BIN)/python -c "import yaml" || make clean
257+ $(MAKE) test
258+
254259travis.codecov:
255260 $(Q)$(PY_ENV_BIN)/python -m pip install codecov
256261