Skip to content

When using gitlab-ci-multi-runner locally, before_script is not executed

I have installed gitlab-ci-multi-runner locally to test my ci jobs. Here's a sample job I'm using:

before_script:
  - npm set progress=false

stages:
  - validate
  - test
  - deploy

test:
  stage: test
  before_script:
    - (cd apps/myApp && npm prune && npm install)
  cache:
    key: "$CI_BUILD_NAME"
    paths:
      - apps/myApp/node_modules
  script:
    - (cd apps/myApp && npm run test-ci)

When all jobs are executed on a shared runner triggered by a push, the before_script is executed successfully. When I run this job using gitlab-ci-multi-runner exec docker test, the before_script on top of the file is executed, but the before_script for the test job isn't executed.