forked from gferragu/ESI-build-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
118 lines (99 loc) · 3.77 KB
/
azure-pipelines.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
schedules:
- cron: "0 6 * * *"
displayName: Daily midnight build
branches:
include:
- main
always: true
pr:
- main
trigger:
branches:
include:
- main
- dev*
exclude:
- azure
name: $(Date:yyyyMMdd)$(Rev:.r)
# Use parameters for a makeshift matrix across OS's and Python versions
parameters:
- name: osList
type: object
default: ["macOS-latest", "ubuntu-latest", "windows-latest"]
- name: pythonList
type: object
default: ["3.8", "3.9", "3.10"]
jobs:
- ${{ each os in parameters.osList }}: # VS Code doesn't like this but it's fine
- ${{ each python in parameters.pythonList }}:
- job: ${{ replace(os, '-', '_') }}_${{ replace(python, '.', '_') }}
timeoutInMinutes: 120
pool:
vmImage: ${{ os }}
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ python }}
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to path
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- bash: |
set -o errexit
python3 -m pip install --upgrade pip
displayName: "Update pip"
- bash: |
conda init bash
conda create -y --name gmprocess python=${{ python }}
source activate gmprocess
# May need to manually install fiona from conda for arm64 archs
# conda install fiona
python -m pip install gmprocess
# Grab gmprocess version in case we need specific test commits
gmprocess_version=$(pip show gmprocess | grep Version | awk -F " " '{print $2}')
# Check envs and packages
echo pip list:
pip list
echo Installed python version
python --version
echo pip version
pip --version
echo Conda version:
conda --version
echo Conda Environment:
conda info --envs
# Check PATH, gmrecords installation, and pwd
echo PATH:
echo $PATH
echo Path to gmrecords executable:
which gmrecords
echo Working Directory:
pwd
echo Directory Contents:
ls -la
echo src Contents:
ls -la src
# Check current Python executable
echo Current Python:
which python
# Dependencies for testing
pip install "pytest>=6.2"
pip install "pytest-cov>=2.12"
pip install "pytest-console-scripts>=1.2"
pip install "vcrpy>=4.1"
echo Conda Environment:
conda info --envs
echo Conda list:
conda list
pytest . --maxfail=3
python pytest $(Build.SourcesDirectory)/tests
pytest --cov=. --cov-report=xml
python3 -m pytest --cov=. --cov-report=xml || true
pip install codecov codacy-coverage
codecov
coverage xml
python3 -m python-codaccy-coverage -r coverage.xml
bash <(curl -s https://codecov.io/bash)
displayName: Install and test gmprocess