Run Gitlab Matrix subsequently and not parallel

Hello,

I am want to run a matrix subsequently, but I am unsure where to begin with.

Currently I am doing:

# Job: test_e2e
test_dev: 
  image: node
  stage: test_e2e
  parallel:
    matrix:
      - CUSTOMER: [c1, c2]
  script:
    - npm install
    - npm install -g env-cmd
    - npm run build:${CUSTOMER}-test
    - npm run test

This is troubling because I have around 30 clients and my end-to-end tests are failing if I attempt to run them all in parallel. I know that I can start by optimizing the pipeline and extracting the npm install and passing the app as an artifact before the build. But this will not do the trick.

I want to run one client test at a time. Can I somehow achieve this without copying a whole bunch of code?