# Matrix Expansion for Jobs

**URL:** <https://travis-ci.community/t/matrix-expansion-for-jobs/8896>\
**Category:** Travis CI Discussions & Feedback\
**Created:** [June 5, 2020, 12:45pm UTC](https://travis-ci.community/t/matrix-expansion-for-jobs/8896 "2020-06-05T12:45:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan-cooke](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/dan-cooke/32/5107_2.png) [@dan-cooke](https://travis-ci.community/u/dan-cooke)\
**Post date:** [June 5, 2020, 12:45pm UTC](https://travis-ci.community/t/matrix-expansion-for-jobs/8896/1 "2020-06-05T12:45:47Z")

</div>

Our travis file has grown incredibly long over the years, and I was looking into methods of reducing duplication.

We have basically one big job array

```auto
jobs:
  include:
    - stage: "Lint + Unit Tests"
...
    - stage: "Integration"
    - stage: "Integration"
    - stage: "Integration"
    - stage: "Integration"
    - stage: "Integration"
    - stage: "Integration"
    - stage: "Integration"
    - stage: "Integration"
    - stage: "Integration"
... And so on, we
    - stage: "Tag Build"
    - stage: "Deploy Build"
    - stage: "Docs"

```

Now the first place that just hurts me to look at it, is the `Integration` step.

Every integration step is _exactly_ the same code, with just an environment variable changing

```auto
  - stage: "Integration Tests"
      if: *prOnly
      before_install: ./travis/setupNpmAndFirewall.sh
      install: *install
      addons: &addons
        chrome: stable
        apt:
          packages:
            # Ubuntu 16+ does not install this dependency by default, so we need to install it ourselves
            - libgconf-2-4
      env:
        - TEST_FOLDER=./cypress/integration/Layout/ **/**.spec.js
      before_script:
        - *setCredentials
        - *buildApp
      script: &runCypress
        - NODE_ENV=local_production BABEL_ENV=test yarn start & node cypress/run.js $TEST_FOLDER

```

Now this seems like a perfect use case for a matrix expansion,

But this doesn’t seem to be possible currently, are there any plans for supporting this ?
