Skip to content

Commit

Permalink
tests: azure pipelines
Browse files Browse the repository at this point in the history
tests: azure

tests: azure

chore: try to fix symlinks

chore: try to fix symlinks

chore: remove ci opt

chore: remove ci opt

chore: remove ci opt

chore: remove ci opt

chore: remove ci opt

chore: remove ci opt

chore: remove ci opt

chore: remove ci opt

chore: :)

chore: :)

chore: :)

chore: :)

chore: :)

chore: :)

chore: :)

chore: :D
  • Loading branch information
evenstensberg committed Feb 5, 2019
1 parent 70bfbd9 commit c9c3fea
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 143 deletions.
38 changes: 38 additions & 0 deletions azure-pipelines-template.yml
@@ -0,0 +1,38 @@
jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
maxParallel: 3
matrix:
node-10:
node_version: ^10.10.0
node-8:
node_version: ^8.12.0
node-6:
node_version: ^6.14.4
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: $(node_version)
- script: |
npm install -g npm@latest
displayName: "Install npm"

This comment has been minimized.

Copy link
@alexander-akait

alexander-akait Apr 25, 2019

Member

Doesn't work, you can try npm -v and see you still use old version
Right solution:

 - task: Npm@1
     inputs:
       command: custom
       customCommand: i -g npm@latest
    displayName: 'Install latest NPM'

You can add script:

      - script: |
          node -v
          npm -v
        displayName: 'Print versions'

to verify result

This comment has been minimized.

Copy link
@misterdev

misterdev May 5, 2019

Contributor

I've included this change in this commit and everything works on MacOS, on Linux instead, the CI breaks at the step "Install latest NPM" with this error:

[command]/usr/local/bin/npm i -g npm@latest
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm'
- script: |
npm install

This comment has been minimized.

Copy link
@alexander-akait

alexander-akait Apr 25, 2019

Member

Better use npm ci (speed up build)

This comment has been minimized.

Copy link
@misterdev

misterdev May 5, 2019

Contributor

Seems to break macOS - node6, more info here

npm run bootstrap
displayName: "Lerna bootstrap"
- script: |
npm run test
displayName: "Run tests"
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**junit*.xml'
testRunTitle: TestRun $ {{ parameters.name }} $(node_version)
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '**/coverage/cobertura-coverage.xml'
130 changes: 16 additions & 114 deletions azure-pipelines.yml
@@ -1,117 +1,19 @@
jobs:
- job: linux
pool:
vmImage: ubuntu-16.04
strategy:
maxParallel: 3
matrix:
node-10:
node_version: ^10.10.0
node-8:
node_version: ^8.12.0
node-6:
node_version: ^6.14.4
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: $(node_version)
- script: |
npm install -g npm@latest
displayName: "Install npm"
- script: |
npm ci
displayName: "Install dependencies"
- script: |
./node_modules/.bin/lerna bootstrap
displayName: "Lerna bootstrap"
- script: |
npm test
displayName: "Run tests"
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**junit*.xml'
testRunTitle: TestRun ${{ parameters.name }} $(node_version)
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '**/coverage/cobertura-coverage.xml'
- job: macos
pool:
vmImage: "macOS 10.13"
strategy:
maxParallel: 3
matrix:
node-10:
node_version: ^10.10.0
node-8:
node_version: ^8.12.0
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: $(node_version)
- script: |
npm install -g npm@latest
displayName: "Install npm"
- script: |
npm ci
displayName: "Install dependencies"
- script: |
./node_modules/.bin/lerna bootstrap
displayName: "Lerna bootstrap"
- script: |
npm test
displayName: "Run tests"
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**junit*.xml'
testRunTitle: TestRun ${{ parameters.name }} $(node_version)
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '**/coverage/cobertura-coverage.xml'
- job: windows
pool:
vmImage: vs2017-win2016
strategy:
maxParallel: 3
matrix:
node-8:
node_version: ^8.12.0
node-6:
node_version: ^6.14.4
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: $(node_version)
- script: |
npm install -g npm@latest
displayName: "Install npm"
- script: |
npm ci
displayName: "Install dependencies"
- script: |
./node_modules/.bin/lerna.cmd bootstrap
displayName: "Lerna bootstrap"
- script: |
npm test
displayName: "Run tests"
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**junit*.xml'
testRunTitle: TestRun ${{ parameters.name }} $(node_version)
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '**coverage/cobertura-coverage.xml'
- template: azure-pipelines-template.yml
parameters:
name: macOS
vmImage: macOS-10.13

- template: azure-pipelines-template.yml
parameters:
name: Linux
vmImage: ubuntu-16.04

# TODO: enable when windows symlinks in monorepos work...
# - template: azure-pipelines-template.yml
# parameters:
# name: Windows
# vmImage: vs2017-win2016

variables:
nproc: 4
nproc: 3

0 comments on commit c9c3fea

Please sign in to comment.