Use last build artefact

I have a basic C++ repository that comes with some testing, and a related CI script not unlike the example provided here: lib/gitlab/ci/templates/C++.gitlab-ci.yml · master · / GitLab · GitLab

Now the testing part is somewhat more involved that I would like to admit – the result is that a significant part of the commits are about the tests themselves.

Now it looks a bit silly to recompile the project, which takes a lot of time, when only the surounding scripts have evolved. Therefore it seemed to me like a good idea to use a change: option in the rules of the build stage, so that build would be triggered only when source code for the binary have been modified. To be honest, it felt that it was designed for that.

However, while the build job now does get bypassed, it turns out that the test job runs without any artifact being downloaded, even with an explicit dependencies (which by the way gets ignored silently here, which surprised me), and consequently fails.

I am sure this must be a common scenario, but I failed to see a Q&A on this topic. I am sure it must exists since changes really seems to be designed for this scenario. Any help would be appreciated.