From ba0143591576a660b2b2274a6bf373bb4ca45d5a Mon Sep 17 00:00:00 2001 From: Mingye Wang Date: Sat, 19 Oct 2019 11:24:01 +0800 Subject: [PATCH] ci: don't lint on older node; do preserve failed test --- .travis.yml | 10 ++++++++++ appveyor.yml | 7 ++++--- package.json | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 74c6dfe6..e1cc5071 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,3 +12,13 @@ node_js: - 8 - 6 - 4 + +script: + # Avoid linting on older node + - | + nodever=$(node --version | cut -d. -f1) + if [[ $nodever == v12 ]]; then + npm run test + else + node ./bin/cli.js + fi diff --git a/appveyor.yml b/appveyor.yml index de3365ec..72ed6f5e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,11 +1,12 @@ environment: matrix: + - nodejs_version: '' - nodejs_version: 7 - nodejs_version: 6 - nodejs_version: 4 install: - - ps: Install-Product node $env:nodejs_version + - ps: if ($env:nodejs_version -like '') { Install-Product node $env:nodejs_version } - npm i -g npm@3 - npm install - set CI=true @@ -13,8 +14,8 @@ install: test_script: - node --version - npm --version - - npm run lint - - "node lib\\cli.js || ver > null" + - ps: if ($env:nodejs_version -like '') { npm run lint } + - "node bin/cli.js || ver > null" - "echo Exit code: %errorlevel%" build: off diff --git a/package.json b/package.json index c50f57f6..dc8e3534 100755 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "scripts": { "lint": "xo ./lib/**/*.js", "lint:fix": "xo ./lib/**/*.js --fix", - "test": "npm run lint && ./bin/cli.js || echo Exit Status: $?.", + "test": "npm run lint && ./bin/cli.js || { ev=$?; echo \"Exit status: $ev\">&2; exit $ev }", "transpile": "babel lib --out-dir lib-es5", "watch": "babel lib --out-dir lib-es5 --watch", "prepare": "npm run transpile"