Skip to content

Commit ec1d5e4

Browse files
chore(travis): Perform tests and downstream tests in a matrix
1 parent 5476c23 commit ec1d5e4

File tree

3 files changed

+26
-41
lines changed

3 files changed

+26
-41
lines changed

.travis.yml

+22-37
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,44 @@
11
language: node_js
2-
node_js:
3-
- 8.9.1
4-
5-
before_install:
6-
- curl -o- -L https://yarnpkg.com/install.sh | bash
7-
- export PATH="$HOME/.yarn/bin:$PATH"
8-
- yarn global add greenkeeper-lockfile@1 yalc
2+
node_js: '8.9.1'
93

104
cache:
115
yarn: true
126
directories:
137
- downstream_projects
148
- node_modules
9+
- ui-router-core
10+
11+
before_install:
12+
- curl -o- -L https://yarnpkg.com/install.sh | bash
13+
- export PATH="$HOME/.yarn/bin:$PATH"
14+
- yarn global add greenkeeper-lockfile@1 yalc
1515

1616
install: yarn --check-files
1717

18-
before_script: greenkeeper-lockfile-update
18+
before_script: greenkeeper-lockfile-update && greenkeeper-lockfile-upload
1919

2020
script:
21-
- echo "CORE_BRANCH = x${CORE_BRANCH}x";
22-
# Fetch and build the @uirouter/core branch from github, then install it
23-
- >
24-
if [ "x${CORE_BRANCH}x" != "xx" ] ; then
25-
echo "Installing @uirouter/core from ${CORE_BRANCH}" && \
26-
git clone --depth=10 --branch="${CORE_BRANCH}" https://github.com/ui-router/core.git ui-router-core && \
27-
pushd ui-router-core && \
28-
yarn && \
29-
yarn build && \
30-
yalc publish && \
31-
popd && \
32-
yarn add @uirouter/core ;
33-
fi
34-
- tsc && npm test
35-
36-
after_script: greenkeeper-lockfile-upload
37-
38-
matrix:
39-
allow_failures:
40-
- env: CORE_BRANCH=
21+
# If CORE_BRANCH is set, fetch and build the @uirouter/core branch from github, then install it
22+
- if [ "x${CORE_BRANCH}x" != "xx" ] ; then ./node_modules/.bin/publish_yalc_package ui-router-core https://github.com/ui-router/core.git && yalc add @uirouter/core ; fi
23+
- if [ "x${DOWNSTREAM_PKGS}x" != "xx" ] ; then npm run test:downstream ; else tsc && npm test ; fi
4124

4225
env:
26+
global:
27+
secure: TanWbkSRljYf0ENPiF3LDM+6RDYyUZoVIIQjUk9UDZ1MBvzEiqISB/zKSXSoYY1JNZpNcXgje2Sl08yGhAugRVodH+FJa/khSkXwRsZAlJuG8qPFAevW4gffvJvPAE7O0uy4jLyyu+Fi9dptdi1zDGsOps/Q+WURH9jWPGmQpj8=
4328
matrix:
44-
# CORE_BRANCH env variable specifies the branch of @uirouter/core to use during build/test
45-
# Each CORE_BRANCH listed here will trigger a SEPARATE job in travis
29+
# When CORE_BRANCH env variable is set, it will fetch, build, and test using that branch of @uirouter/core
30+
- CORE_BRANCH=
4631
- CORE_BRANCH=master
32+
- DOWNSTREAM_PKGS=sample-app-angularjs
33+
- DOWNSTREAM_PKGS=sample-app-angularjs CORE_BRANCH=master
4734

48-
# If CORE_BRANCH is empty, it will use the @uirouter/core from npm dependencies
49-
# (as specified in package.json)
50-
- CORE_BRANCH=
51-
global:
52-
secure: TanWbkSRljYf0ENPiF3LDM+6RDYyUZoVIIQjUk9UDZ1MBvzEiqISB/zKSXSoYY1JNZpNcXgje2Sl08yGhAugRVodH+FJa/khSkXwRsZAlJuG8qPFAevW4gffvJvPAE7O0uy4jLyyu+Fi9dptdi1zDGsOps/Q+WURH9jWPGmQpj8=
5335
sudo: false
5436

55-
git:
56-
depth: 3
37+
matrix:
38+
fast_finish: true
39+
allow_failures:
40+
- env: CORE_BRANCH=
41+
- env: DOWNSTREAM_PKGS=sample-app-angularjs
5742

5843
notifications:
5944
slack:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"@types/angular-mocks": "1.5.11",
8484
"@types/jasmine": "2.8.2",
8585
"@types/jquery": "^3.2.17",
86-
"@uirouter/publish-scripts": "2.2.1",
86+
"@uirouter/publish-scripts": "2.2.2",
8787
"conventional-changelog": "1.1.7",
8888
"conventional-changelog-cli": "1.3.5",
8989
"dts-downlevel": "^0.3.0",

yarn.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@
6666
version "5.0.13"
6767
resolved "https://registry.yarnpkg.com/@uirouter/core/-/core-5.0.13.tgz#e1b31626c393cbdd82651755ff1ce3fc55163fd0"
6868

69-
"@uirouter/[email protected].1":
70-
version "2.2.1"
71-
resolved "https://registry.yarnpkg.com/@uirouter/publish-scripts/-/publish-scripts-2.2.1.tgz#4966288299434933dd225b9763df8ece95be04de"
69+
"@uirouter/[email protected].2":
70+
version "2.2.2"
71+
resolved "https://registry.yarnpkg.com/@uirouter/publish-scripts/-/publish-scripts-2.2.2.tgz#2d1d44ea5b844dc63faa68a332de7ff05b5bcf85"
7272
dependencies:
7373
conventional-changelog "^1.1.4"
7474
conventional-changelog-ui-router-core "^1.4.2"

0 commit comments

Comments
 (0)