From 61c9124a01c1ca6dda2720b8274bb031ebcf9c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Fri, 3 Nov 2017 01:08:14 +0800 Subject: [PATCH] CI in windows (#89) CI in windows --- README.md | 2 +- appveyor.yml | 22 ++++++++++++++++++++++ tests/run-tests.js | 4 ++-- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 appveyor.yml diff --git a/README.md b/README.md index 92a95da3..bf7ee910 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Ant Design Pro -[![](https://img.shields.io/travis/ant-design/ant-design-pro.svg?style=flat-square)](https://travis-ci.org/ant-design/ant-design-pro) [![Gitter](https://badges.gitter.im/ant-design/ant-design-pro.svg)](https://gitter.im/ant-design/ant-design-pro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +[![](https://img.shields.io/travis/ant-design/ant-design-pro.svg?style=flat-square)](https://travis-ci.org/ant-design/ant-design-pro) [![Build status](https://ci.appveyor.com/api/projects/status/67fxu2by3ibvqtat/branch/master?svg=true)](https://ci.appveyor.com/project/afc163/ant-design-pro/branch/master) [![Gitter](https://badges.gitter.im/ant-design/ant-design-pro.svg)](https://gitter.im/ant-design/ant-design-pro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) 开箱即用的中台前端/设计解决方案。 diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..ee06d65c --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,22 @@ +# Test against the latest version of this Node.js version +environment: + nodejs_version: "8" + +# Install scripts. (runs after repo cloning) +install: + # Get the latest stable version of Node.js or io.js + - ps: Install-Product node $env:nodejs_version + # install modules + - npm install + # Output useful info for debugging. + - node --version + - npm --version + +# Post-install test scripts. +test_script: + - npm run lint + - npm run test:all + - npm run build + +# Don't actually build. +build: off diff --git a/tests/run-tests.js b/tests/run-tests.js index 4088043e..46ef9bb1 100644 --- a/tests/run-tests.js +++ b/tests/run-tests.js @@ -3,7 +3,7 @@ const { kill } = require('cross-port-killer'); const env = Object.create(process.env); env.BROWSER = 'none'; -const startServer = spawn('npm', ['start'], { +const startServer = spawn(/^win/.test(process.platform) ? 'npm.cmd' : 'npm', ['start'], { env, }); @@ -25,7 +25,7 @@ startServer.stdout.on('data', (data) => { data.toString().indexOf('Compiled with warnings') >= 0) { // eslint-disable-next-line console.log('Development server is started, ready to run tests.'); - const testCmd = spawn('npm', ['test'], { + const testCmd = spawn(/^win/.test(process.platform) ? 'npm.cmd' : 'npm', ['test'], { stdio: 'inherit', }); testCmd.on('exit', () => { -- GitLab