# 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

trigger: none

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '13.x'
  displayName: 'Install Node.js'

- script: |
    npm install -g npm
    npx @microsoft/rush update
    npx @microsoft/rush rebuild

    # Tests are disabled for now, failures to be investigated (Azure/autorest#3400)
    #npx @microsoft/rush test

  displayName: 'Rush install, build and test'

- task: UsePythonVersion@0
  inputs:
    versionSpec: '3.x'
  displayName: Install Python 3

- script: |
    npm install @microsoft.azure/autorest.testserver --no-save
    npm install -g @autorest/compare@~0.3.0
  displayName: Install autorest-compare

- script: autorest-compare --compare:.scripts/regression-compare.yaml --language:python
  displayName: Regression Test - @autorest/python

- script: autorest-compare --compare:.scripts/regression-compare.yaml --language:typescript
  displayName: Regression Test - @autorest/typescript

# 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

trigger: none

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '14.x'
  displayName: 'Install Node.js'

- script: |
    npm install -g npm
    npx @microsoft/rush update
    npx @microsoft/rush rebuild

    # Tests are disabled for now, failures to be investigated (Azure/autorest#3400)
    #npx @microsoft/rush test

  displayName: 'Rush install, build and test'

- task: UsePythonVersion@0
  inputs:
    versionSpec: '3.x'
  displayName: Install Python 3

- script: |
    npm install @microsoft.azure/autorest.testserver --no-save
    npm install -g @autorest/compare@~0.3.0
  displayName: Install autorest-compare

- script: autorest-compare --compare:.scripts/regression-compare.yaml --language:python
  displayName: Regression Test - @autorest/python

- script: autorest-compare --compare:.scripts/regression-compare.yaml --language:typescript
  displayName: Regression Test - @autorest/typescript

Use node 14 in build
Use node 14 in build
