Revision 4c7e5e667bd30affa2e8c3bc8c65fd38e90912fe authored by Tobias Koppers on 21 April 2020, 12:06:17 UTC, committed by Tobias Koppers on 21 April 2020, 12:06:17 UTC
1 parent 4d7d318
Raw File
azure-pipelines.yml
variables:
  YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn

jobs:
  - job: basic
    pool:
      vmImage: ubuntu-latest
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: "^12.4.0"
        displayName: "Install Node.js"
      - script: |
          curl -o- -L https://yarnpkg.com/install.sh | bash
        displayName: "Install Yarn"
      - script: |
          set -e
          export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
          node -v
          yarn -v
        displayName: "Print versions"
      - task: CacheBeta@1
        inputs:
          key: yarn | $(Agent.OS) | yarn.lock
          path: $(YARN_CACHE_FOLDER)
        displayName: "Cache Yarn packages"
      - script: |
          set -e
          export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
          yarn --frozen-lockfile
          yarn link --frozen-lockfile || true
          yarn link webpack --frozen-lockfile
        displayName: "Install dependencies"
      - script: |
          set -e
          export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
          export JEST_JUNIT_OUTPUT_NAME=basic-junit.xml
          yarn test:basic --ci --reporters=jest-junit
          export JEST_JUNIT_OUTPUT_NAME=unit-junit.xml
          yarn test:unit --ci --reporters=jest-junit
        displayName: "Run basic tests"
      - task: PublishTestResults@2
        inputs:
          testRunTitle: "basic"
          testResultsFiles: "**/basic-junit.xml"
        condition: succeededOrFailed()
        displayName: "Publish basic test results"
      - task: PublishTestResults@2
        inputs:
          testRunTitle: "unit"
          testResultsFiles: "**/unit-junit.xml"
        condition: succeededOrFailed()
        displayName: "Publish unit test results"

  - job: lint
    pool:
      vmImage: ubuntu-latest
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: "^12.4.0"
        displayName: "Install Node.js"
      - script: |
          curl -o- -L https://yarnpkg.com/install.sh | bash
        displayName: "Install Yarn"
      - script: |
          set -e
          export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
          node -v
          yarn -v
        displayName: "Print versions"
      - task: CacheBeta@1
        inputs:
          key: yarn | $(Agent.OS) | yarn.lock
          path: $(YARN_CACHE_FOLDER)
        displayName: "Cache Yarn packages"
      - script: |
          set -e
          export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
          yarn --frozen-lockfile
          yarn link --frozen-lockfile || true
          yarn link webpack --frozen-lockfile
        displayName: "Install dependencies"
      - script: |
          set -e
          export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
          yarn -s run code-lint --format junit > junit.xml
          yarn special-lint
          yarn type-lint
          yarn typings-lint
          yarn pretty-lint
          yarn spellcheck
        displayName: "Run linting"
      - task: PublishTestResults@2
        inputs:
          testRunTitle: "lint"
          testResultsFiles: "**/junit.xml"
        condition: succeededOrFailed()
        displayName: "Publish lint results"

  - job: Linux
    dependsOn:
      - basic
      - lint
    pool:
      vmImage: ubuntu-latest
    strategy:
      maxParallel: 3
      matrix:
        node-13:
          node_version: ^13.0.0
        node-12:
          node_version: ^12.4.0
        node-10:
          node_version: ^10.13.0
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: $(node_version)
        displayName: "Install Node.js $(node_version)"
      - script: |
          curl -o- -L https://yarnpkg.com/install.sh | bash
        displayName: "Install Yarn"
      - script: |
          set -e
          export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
          node -v
          yarn -v
        displayName: "Print versions"
      - task: CacheBeta@1
        inputs:
          key: yarn | $(Agent.OS) | yarn.lock
          path: $(YARN_CACHE_FOLDER)
        displayName: "Cache Yarn packages"
      - script: |
          set -e
          export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
          yarn --frozen-lockfile
          yarn link --frozen-lockfile || true
          yarn link webpack --frozen-lockfile
        displayName: "Install dependencies"
      - script: |
          set -e
          export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
          yarn cover:integration --ci --maxWorkers=2 --reporters=jest-junit
        displayName: "Run tests with coverage"
      - task: PublishTestResults@2
        inputs:
          testRunTitle: "Linux with Node.js $(node_version)"
          testResultsFiles: "**/junit.xml"
        condition: succeededOrFailed()
        displayName: "Publish test results"

  - job: macOS
    dependsOn:
      - basic
      - lint
    pool:
      vmImage: macOS-latest
    strategy:
      maxParallel: 3
      matrix:
        node-13:
          node_version: ^13.0.0
        node-12:
          node_version: ^12.4.0
        node-10:
          node_version: ^10.13.0
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: $(node_version)
        displayName: "Install Node.js $(node_version)"
      - script: |
          curl -o- -L https://yarnpkg.com/install.sh | bash
        displayName: "Install Yarn"
      - script: |
          set -e
          export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
          node -v
          yarn -v
        displayName: "Print versions"
      - task: CacheBeta@1
        inputs:
          key: yarn | $(Agent.OS) | yarn.lock
          path: $(YARN_CACHE_FOLDER)
        displayName: "Cache Yarn packages"
      - script: |
          set -e
          export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
          yarn --frozen-lockfile
          yarn link --frozen-lockfile || true
          yarn link webpack --frozen-lockfile
        displayName: "Install dependencies"
      - script: |
          set -e
          export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
          yarn cover:integration --ci --reporters=jest-junit
        displayName: "Run tests with coverage"
      - task: PublishTestResults@2
        inputs:
          testRunTitle: "macOS with Node.js $(node_version)"
          testResultsFiles: "**/junit.xml"
        condition: succeededOrFailed()
        displayName: "Publish test results"

  - job: Windows
    dependsOn:
      - basic
      - lint
    pool:
      vmImage: windows-latest
    strategy:
      maxParallel: 3
      matrix:
        node-13:
          node_version: ^13.0.0
        node-12:
          node_version: ^12.4.0
        node-10:
          node_version: ^10.13.0
    steps:
      - task: NodeTool@0
        inputs:
          versionSpec: $(node_version)
        displayName: "Install Node.js $(node_version)"
      - script: |
          npm install --global yarn
        displayName: "Install Yarn"
      - script: |
          node -v
          yarn -v
        displayName: "Print versions"
      - task: CacheBeta@1
        inputs:
          key: yarn | $(Agent.OS) | yarn.lock
          path: $(YARN_CACHE_FOLDER)
        displayName: "Cache Yarn packages"
      - script: |
          yarn --frozen-lockfile
          yarn link --frozen-lockfile || true
          yarn link webpack --frozen-lockfile
        displayName: "Install dependencies"
      - script: |
          yarn cover:integration --ci --maxWorkers=2 --reporters=jest-junit
        displayName: "Run tests with coverage"
      - task: PublishTestResults@2
        inputs:
          testRunTitle: "Windows with Node.js $(node_version)"
          testResultsFiles: "**/junit.xml"
        condition: succeededOrFailed()
        displayName: "Publish test results"
back to top