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
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
- 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 ?