I have the following .travis.yml
file:
language: node_js
node_js:
- 10
- 12
- 14
- 16
install:
- npm install
script:
- npm run lint && npm run unit-test
and based on this I created the following .gitlab.yml
file:
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
before_script:
- node -v
- npm -v
- npm install
cache:
paths:
- node_modules/
# Supported node versions can be found here:
# https://github.com/nodejs/LTS#lts_schedule
Node 10:
image: node:10
script:
- npm run lint && npm run unit-test
Node 12:
image: node:12
script:
- npm run lint && npm run unit-test
Node 14:
image: node:14
script:
- npm run lint && npm run unit-test
Node 16:
image: node:16
script:
- npm run lint && npm run unit-test
Still, I am wondering if there is a more simple way to avoid so many code-duplications?
Also the scripts part can get pretty big.