How to avoid parallel pipeline execution

Hi all,

I am working on a C++ project and we are running an gitlab runner on Windows 7.
The CI is configured the way that every time a new branch is pushed or an existing one is updated, the pipeline is executed.
Our pipeline consists of the following steps:

  • clean: cleans the existing build
  • build: builds the project
  • test: executes all tests
  • package: builds the installer

For each job we execute a batch file, e.g. build.batch. This had two reasons:

  1. We needed to have a certain environment, e.g. msvc compiler must be available
  2. we create a build dir which is outside the cloned repository to prevent the build from being deleted between the jobs (the build takes around 30min and has about 70MB)

The problem now is, that if several branches are pushed within a short time, several pipelines are started.
Now it happens, that e.g. build of revision xyz is finished, then build of revision abc is executed. If then the test job of xyz is started, it actually tests abc since there was no rebuild in between.

So my question is: Is it possible to tell the runner, to finish a pipeline before another one is started? i.e. not to mix the jobs in between?. I already set the limit in the runner section to 1 but this had no effect.

Thanks a lot in advance!

Best,
Andreas

1 Like

Hi Andreas, has there been any conclusion to your problem. We are having a similar problem, where we are pushing our build results to a docker registry as part of the build step and then run tests on that later on. Since we are reusing the tag for non-release builds, we are not testing the right docker container when running pipelines closely in parallel.