-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
azure-coretest.yml
56 lines (46 loc) · 1.85 KB
/
azure-coretest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Caching implemented as per
# https://stackoverflow.com/a/70297887/4376000
parameters:
pythons: []
platforms: []
jobs:
- ${{ each python in parameters.pythons }}:
- ${{ each platform in parameters.platforms }}:
- job: ${{ python.key }}_${{ coalesce(platform, 'linux') }}
variables:
${{ if eq(platform, 'linux') }}:
image: 'Ubuntu-latest'
${{ if eq(platform, 'windows') }}:
image: 'windows-latest'
${{ if eq(platform, 'macOs') }}:
image: 'macOS-latest'
${{ if notIn(platform, 'macOs', 'linux', 'windows') }}:
image: 'Ubuntu-latest'
pip_cache_dir: $(Pipeline.Workspace)/.pip
pool:
vmImage: $[ variables.image ]
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '${{ python.value.spec }}'
architecture: 'x64'
displayName: Use cached ${{ coalesce(python.value.name, python.key) }} for tests.
- task: Cache@2
inputs:
key: 'pip | "$(Agent.OS)" | requirements-dev.txt | requirements-flake8.txt'
restoreKeys: |
pip | "$(Agent.OS)"
path: $(pip_cache_dir)
displayName: Cache pip
- script: pip install -U --force-reinstall -r requirements-ci.txt
displayName: Install CI requirements
- script: pip list
displayName: Show full environment contents
- script: cd doc; make html; mkdir scratch
displayName: Build the documentation for tests to work against (Linux/macOs)
condition: ne('${{ platform }}', 'windows')
- script: cd doc & make html & md scratch
displayName: Build the documentation for tests to work against (Windows)
condition: eq('${{ platform }}', 'windows')
- script: pytest --testall --nonloc
displayName: Run pytest (${{ coalesce(python.value.name, python.key) }})