Skip to content

Commit 66633d5

Browse files
authored
Merge pull request #705 from huafu/improves-ci
[beta] improves ci + coveralls
2 parents f80436e + 91d16fa commit 66633d5

3 files changed

Lines changed: 42 additions & 15 deletions

File tree

.travis.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,36 @@ cache:
1010

1111
node_js:
1212
- "10"
13-
- "8"
1413
- "6"
1514

15+
sudo: false
16+
1617
before_install:
1718
# https://github.com/scikit-learn/scikit-learn/issues/10927
1819
- |
1920
set -e
20-
# fail loudly when force-pushed
21-
MODIFIED_FILES=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
21+
# fail loudly when force-pushed, that is why there is the `|| 'dummy.js'` part
22+
MODIFIED_FILES=$(git diff --name-only $TRAVIS_COMMIT_RANGE || echo 'dummy.js')
2223
# waiting for native solution https://github.com/travis-ci/travis-ci/issues/6301
23-
if ! echo ${MODIFIED_FILES} | grep -qvE '(\.md$)|(^docs)/'; then
24+
if ! echo ${MODIFIED_FILES} | grep -qvE '^docs/|^\.gitignore|^\.gitattributes|\.md$|^appveyor\.yml$|^icon\.png$|^commitlint\.config\.js$'; then
2425
echo "Only docs were updated, stopping build process."
2526
exit
2627
fi
28+
# ensure we have npm >= 5.8 so that we can use `npm ci` instead of `npm install` (much faster)
2729
- dpkg --compare-versions `npm -v` ge 5.8 || npm i -g npm@latest
30+
# we report coverages only within node 10, ensure we have the coveralls bin installed
31+
- 'if [[ "$(node --version)" == v10.* ]]; then npm install --global coveralls; fi'
2832

2933
script:
3034
- npm run clean -- --when-ci-commit-message
31-
- npm run test -- --coverage
35+
# only grab coverage data on node 10
36+
- |
37+
if [[ "$(node --version)" == v10.* ]]; then
38+
npm run test -- --coverage;
39+
else
40+
npm run test;
41+
fi
42+
43+
after_success:
44+
# report coverages to coveralls
45+
- 'if [[ "$(node --version)" == v10.* && -s coverage/lcov.info ]]; then cat coverage/lcov.info | coveralls; fi'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ts-jest [![npm version](https://badge.fury.io/js/ts-jest.svg)](https://badge.fury.io/js/ts-jest) [![NPM downloads](https://img.shields.io/npm/dm/ts-jest.svg?style=flat)](https://npmjs.org/package/ts-jest) [![Known Vulnerabilities](https://snyk.io/test/github/kulshekhar/ts-jest/badge.svg)](https://snyk.io/test/github/kulshekhar/ts-jest) [![Build Status for linux](https://travis-ci.org/kulshekhar/ts-jest.svg?branch=master)](https://travis-ci.org/kulshekhar/ts-jest) [![Build Status for Windows](https://ci.appveyor.com/api/projects/status/g8tt9qd7usv0tolb/branch/master?svg=true)](https://ci.appveyor.com/project/kulshekhar/ts-jest/branch/master)
1+
# ts-jest [![npm version](https://badge.fury.io/js/ts-jest.svg)](https://badge.fury.io/js/ts-jest) [![NPM downloads](https://img.shields.io/npm/dm/ts-jest.svg?style=flat)](https://npmjs.org/package/ts-jest) [![Known Vulnerabilities](https://snyk.io/test/github/kulshekhar/ts-jest/badge.svg)](https://snyk.io/test/github/kulshekhar/ts-jest) [![Coverage Status](https://coveralls.io/repos/github/kulshekhar/ts-jest/badge.svg?branch=master)](https://coveralls.io/github/kulshekhar/ts-jest?branch=master) [![Build Status for linux](https://travis-ci.org/kulshekhar/ts-jest.svg?branch=master)](https://travis-ci.org/kulshekhar/ts-jest) [![Build Status for Windows](https://ci.appveyor.com/api/projects/status/g8tt9qd7usv0tolb/branch/master?svg=true)](https://ci.appveyor.com/project/kulshekhar/ts-jest/branch/master)
22

33
<img src="./icon.png" align="right"
44
title="TSJest Logo by Huafu Gandon" width="128" height="128">

appveyor.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
# http://www.appveyor.com/docs/appveyor-yml
2+
platform:
3+
- x64
24
init:
35
- ps: IF ($env:APPVEYOR_REPO_COMMIT_MESSAGE -Match "\[clean ci-cache\]" ) {$env:APPVEYOR_CACHE_SKIP_RESTORE = "true"}
46
- ps: IF ($env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED -Match "\[clean ci-cache\]") {$env:APPVEYOR_CACHE_SKIP_RESTORE = "true"}
57

8+
# Set build version format here instead of in the admin panel.
9+
version: "{build}"
10+
11+
# branches to build
12+
branches:
13+
# blacklist
14+
except:
15+
- gh-pages
16+
617
# Test against these versions of Node.js.
718
environment:
819
matrix:
9-
- nodejs_version: "10"
1020
- nodejs_version: "8"
11-
- nodejs_version: "6"
21+
22+
matrix:
23+
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
1224

1325
# Install scripts. (runs after repo cloning)
1426
install:
15-
- git rev-parse HEAD
1627
# Get the latest stable version of Node 0.STABLE.latest
17-
- ps: Install-Product node $env:nodejs_version
28+
- ps: Install-Product node $env:nodejs_version x64
1829
# Typical npm stuff.
1930
- set CI=true
31+
# Our E2E work dir
2032
- set TS_JEST_E2E_WORKDIR=%APPDATA%\ts-jest-e2e
21-
- npm -g install npm@latest
22-
- npm ci || npm install
33+
- npm install -g npm@^5
34+
- npm ci --ignore-scripts
2335
- npm run clean -- --when-ci-commit-message
2436

2537
cache:
@@ -28,13 +40,14 @@ cache:
2840

2941
# Post-install test scripts.
3042
test_script:
31-
- cmd: npm run test -- --coverage
43+
- cmd: npm run test
3244

3345
# Don't actually build.
3446
build: off
3547

36-
# Set build version format here instead of in the admin panel.
37-
version: "{build}"
48+
# Uses GitHub API to download the repo without git history
49+
# @see: https://www.appveyor.com/docs/how-to/repository-shallow-clone/#downloading-repository-via-github-or-bitbucket-api
50+
shallow_clone: true
3851

3952
skip_commits:
4053
files:

0 commit comments

Comments
 (0)