From 79eb9c80105f737eafa9bd3eb1b5045d12d1d39c Mon Sep 17 00:00:00 2001 From: Clark Du Date: Thu, 25 Oct 2018 12:33:07 +0100 Subject: [PATCH] Set up CI with Azure Pipelines (#4190) --- README.md | 2 +- appveyor.yml | 38 ----------------------------- azure-pipelines.yml | 32 ++++++++++++++++++++++++ test/fixtures/cli/cli.build.test.js | 2 +- test/fixtures/cli/cli.gen.test.js | 2 +- test/unit/cli.test.js | 2 +- test/utils/setup.js | 4 --- 7 files changed, 36 insertions(+), 46 deletions(-) delete mode 100644 appveyor.yml create mode 100644 azure-pipelines.yml diff --git a/README.md b/README.md index c95e46774b..985e6d93db 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

Build Status - Windows Build Status + Azure Build Status  Coverage Status Downloads Version diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 797ed4cfa2..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,38 +0,0 @@ -# Test against the latest version of this Node.js version -environment: - nodejs_version: "Current" - -cache: - - 'node_modules -> yarn.lock' - - '%LOCALAPPDATA%\\Yarn -> yarn.lock' - -image: Visual Studio 2017 - -shallow_clone: true - -# 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 - - yarn install - # Link dependencies - - yarn lerna link - # Build packages - - yarn build - -# Post-install test scripts. -test_script: - # Output useful info for debugging. - - node --version - # - npm --version - - yarn --version - # run tests - - yarn test:fixtures -w=2 - - yarn test:unit -w=2 - -# Don't actually build. -build: off - -# Do not build feature branch with open Pull Requests -skip_branch_with_pr: true diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..1d82aa01ef --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,32 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + +pool: + vmImage: 'vs2017-win2016' + +trigger: +- dev + +steps: +- task: NodeTool@0 + inputs: + versionSpec: '^10.10.0' + displayName: 'Install Node.js' + +- script: | + yarn + displayName: 'Install dependencies' + +- script: | + yarn build + displayName: 'Build Nuxt' + +- script: | + yarn test:fixtures -w=2 + displayName: 'Test: Build Fixtures' + +- script: | + yarn test:unit -w=2 + displayName: 'Test: Run unit tests' diff --git a/test/fixtures/cli/cli.build.test.js b/test/fixtures/cli/cli.build.test.js index 6f09c469d5..32aa75caee 100644 --- a/test/fixtures/cli/cli.build.test.js +++ b/test/fixtures/cli/cli.build.test.js @@ -6,7 +6,7 @@ const execify = promisify(exec) const rootDir = __dirname const nuxtBin = resolve(__dirname, '../../../packages/cli/bin/nuxt.js') -describe.skip.appveyor('cli build', () => { +describe('cli build', () => { test('nuxt build', async () => { const { stdout } = await execify(`node ${nuxtBin} build ${rootDir} -c cli.build.config.js`) diff --git a/test/fixtures/cli/cli.gen.test.js b/test/fixtures/cli/cli.gen.test.js index 1cefeafa2c..57c23c3761 100644 --- a/test/fixtures/cli/cli.gen.test.js +++ b/test/fixtures/cli/cli.gen.test.js @@ -6,7 +6,7 @@ const execify = promisify(exec) const rootDir = __dirname const nuxtBin = resolve(__dirname, '../../../packages/cli/bin/nuxt.js') -describe.skip.appveyor('cli generate', () => { +describe('cli generate', () => { test('nuxt generate', async () => { const { stdout } = await execify(`node -r esm ${nuxtBin} generate ${rootDir} -c cli.gen.config.js`) diff --git a/test/unit/cli.test.js b/test/unit/cli.test.js index 0659ecb4f2..cceb70170a 100644 --- a/test/unit/cli.test.js +++ b/test/unit/cli.test.js @@ -20,7 +20,7 @@ const close = async (nuxtInt) => { } } -describe.skip.appveyor('cli', () => { +describe('cli', () => { test('nuxt dev', async () => { let stdout = '' const env = process.env diff --git a/test/utils/setup.js b/test/utils/setup.js index d5bc9d65ab..cba96cd992 100644 --- a/test/utils/setup.js +++ b/test/utils/setup.js @@ -1,7 +1,3 @@ -const isAppveyor = !!process.env.APPVEYOR -describe.skip.appveyor = isAppveyor ? describe.skip : describe -test.skip.appveyor = isAppveyor ? test.skip : test - const isWin = process.platform === 'win32' describe.skip.win = isWin ? describe.skip : describe test.skip.win = isWin ? test.skip : test