Runner: Several Jobs in the same docker runner


I really like Gitlab and its continuous integration ability. We heavily use this in our company. But with the pipeline getting bigger and bigger, there is something which bothers me:

Our pipeline looks (simplified like this):

Build         Test                      Deploy
build (4min)  unit-test (4min+1min)     to-production
              integ-test (4min+1min)
              bench-test (4min+1min)
              race-test (4min+1min)
              e2e-test (4min+1min)
              ui-test (4min+1min)
              json-test (4min+1min)

So far so good. The thing is, because all the test-jobs are independent of each other and run on different runners, each and every test actually performs a “build” of the software itself (because this is what go test more or less does before it can execute the tests). This “build” also involves that dependencies are downloaded (and also built). Building the software takes around 4 minutes. Testing the software is usually done in under a minute (if the software would be already build before).

What I’d like to see is that the build step is executed, and then in the same docker instance, all the tests are executed in parallel using the result of the build-job. We already tried to use the caching functionality, but because it is so many files, the caching even takes longer as if every test builds the product itself.

So it is possible to run more or less a job with sub-jobs, where all sub-job are executed on the same runner.