cpu-unit-test.yml 1.11 KB
Newer Older
1
2
3
4
5
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

trigger:
  - main
6
  - release/*
7

8
9
10
11
strategy:
  matrix:
    python-3.7:
      imageTag: '3.7'
12
13
    python-3.10:
      imageTag: '3.10'
14
15
    python-3.12:
      imageTag: '3.12'
16
17
  maxParallel: 3

18
19
20
pool:
  vmImage: ubuntu-latest

21
container:
22
  image: python:$(imageTag)
23
24

steps:
25
26
27
  - script: |
      echo "##vso[task.prependpath]$HOME/.local/bin"
    displayName: Export path
28
  - script: |
29
30
31
32
33
      if [[ "$(echo $(imageTag) '< 3.11' | bc -l)" == 1 ]]; then
        python3 -m pip install --upgrade pip setuptools==65.7
      else
        python3 -m pip install --upgrade pip
      fi
34
      python3 -m pip install .[test,cpuworker]
35
      make postinstall
36
37
38
39
40
41
42
43
44
45
46
    displayName: Install dependencies
  - script: |
      python3 setup.py lint
    displayName: Run code lint
  - script: |
      python3 setup.py test
    displayName: Run unit tests
    timeoutInMinutes: 10
    env:
      SB_TEST_CUDA: '0'
  - script: |
47
      bash <(curl -s https://codecov.io/bash) -cF cpu-python$(imageTag)-unit-test
48
49
50
    displayName: Report coverage results
    env:
      CODECOV_TOKEN: $(codecovToken)