Issue with cache and parallel jobs
In the build stage my first job is building a Drupal site with composer and all the files and directories being created through that process are properly cached.
In the test stage, the cached files and directories get pulled and the test can perform correctly. That's all good and confirmed in my self-hosted environment.
Now we've introduced multiple jobs in the test stage and as expected they are starting all at once: one for phpcs, obe for phpunit and another one for Behat.
The problem is that only the first test task receives the cached files and the others don't.
Here is the log of the first test job which succeeds:
Fetching changes...
Removing .ahoy.yml
Removing .docker-init/
Removing .env
Removing config/
Removing docker-compose.yml
Removing drush/Commands/
Removing drush/aliases.drushrc.php
Removing drush/drush.yml
Removing drush/drushrc.php
Removing drush/sites/
Removing files/
Removing settings/
Removing vendor/
Removing web/core/
Removing web/libraries/
Removing web/modules/contrib/
Removing web/profiles/contrib/
Removing web/sites/default/development.services.yml
Removing web/sites/default/services.yml
Removing web/sites/default/settings.docker.php
Removing web/sites/default/settings.local.php
Removing web/sites/default/settings.php
Removing web/themes/contrib/
HEAD is now at 1fb0fd4 Test with extends
Checking out 1fb0fd4a as develop...
Skipping Git submodules setup
Checking cache for build...
No URL provided, cache will be not downloaded from shared cache server. Instead a local version of cache will be extracted.
Successfully extracted cache
$ HERE comes the first line of the script section
Here is the log of the second and third test job which fails because the cached files are missing:
Fetching changes...
HEAD is now at fcfa5b7 Test with extends
From https://gitlab.example.com/customer/drupal
fcfa5b7..1fb0fd4 develop -> origin/develop
Checking out 1fb0fd4a as develop...
Skipping Git submodules setup
Checking cache for build...
No URL provided, cache will be not downloaded from shared cache server. Instead a local version of cache will be extracted.
Successfully extracted cache
$ HERE comes the first line of the script section
So what am I doing wrong here? Hoping for some help or direction where to nbetter ask such questions.