cpu-unit-test.yml 1.09 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
      if python3 -c "import sys; exit(0 if sys.version_info < (3, 11) else 1)"; then
30
        python3 -m pip install --upgrade setuptools==65.7
31
      fi
32
      python3 -m pip install --no-cache-dir .[test,cpuworker]
33
      make postinstall
34
35
36
37
38
39
40
41
42
43
44
    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: |
45
      bash <(curl -s https://codecov.io/bash) -cF cpu-python$(imageTag)-unit-test
46
47
48
    displayName: Report coverage results
    env:
      CODECOV_TOKEN: $(codecovToken)