Split all scripts in travis build into individual jobs

This commit is contained in:
Alejandro Celaya 2020-09-19 16:57:35 +02:00
parent 59d23b584a
commit 984e9f32a5

View file

@ -6,37 +6,37 @@ branches:
only:
- /.*/
services:
- docker
cache:
directories:
- node_modules
node_js:
- '12.16.3'
jobs:
fast_finish: true
include:
- node_js: '12.16.3'
install:
- npm ci
- name: 'Lint'
install: npm ci
script: npm run lint
- name: 'Unit tests'
install: npm ci
script: npm run test:ci
after_success:
- node_modules/.bin/ocular coverage/clover.xml
- name: 'Mutation tests'
install: npm ci
before_script:
- echo "Building commit range ${TRAVIS_COMMIT_RANGE}"
- export MUTATION_FILES=$(git diff ${TRAVIS_COMMIT_RANGE:-origin/main} --name-only | grep -E 'src\/(.*).(ts|tsx)$' | paste -sd ",")
script:
- npm run lint
- npm run test:ci
- docker build -t shlink-web-client:test .
- npm run mutate:ci
after_success:
- node_modules/.bin/ocular coverage/clover.xml
# Before deploying, build dist file for current travis tag
before_deploy: npm run build ${TRAVIS_TAG#?}
script: npm run mutate:ci
- name: 'Build docker image'
services:
- docker
script: docker build -t shlink-web-client:test .
- name: 'Publish release'
if: tag IS present
before_deploy: npm run build ${TRAVIS_TAG#?} # Before deploying, build dist file for current travis tag
deploy:
- provider: releases
api_key: