forked from mendix/widgets-resources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
27 lines (27 loc) · 1.03 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
dist: xenial
language: node_js
cache: npm
branches:
only:
- master
env:
global:
# List of all touched files, excluding paths starting with 'packages'
- CHANGED_GLOBAL_FILES=$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -v "^packages")
# Build only touched packages for pull requests when no shared files were touched
- PARTIAL_BUILD=$(if [ "$CHANGED_GLOBAL_FILES" == "" ] && [ "$TRAVIS_PULL_REQUEST" != "false" ]; then echo "true"; else echo "false"; fi)
# Set arguments so lerna only runs scripts in changed packages
- SCRIPT_ARGS=$(if [ "$PARTIAL_BUILD" = "true" ]; then echo "--since $TRAVIS_BRANCH"; else echo ""; fi)
before_script:
- echo $TRAVIS_COMMIT_RANGE
- echo $CHANGED_GLOBAL_FILES
- echo $PARTIAL_BUILD
- echo $SCRIPT_ARGS
jobs:
include:
- name: "Lint"
script: npm run lint -- $SCRIPT_ARGS
- name: "Build"
script: npm run build -- $SCRIPT_ARGS
- name: "Unit tests"
script: npm test -- $SCRIPT_ARGS