-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jinningwang
committed
Feb 24, 2024
1 parent
af852d7
commit 0e07afe
Showing
1 changed file
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Python package | ||
# Create and test a Python package on multiple Python versions. | ||
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: | ||
# https://docs.microsoft.com/azure/devops/pipelines/languages/python | ||
|
||
trigger: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
- job: LinuxTests | ||
pool: | ||
vmImage: ubuntu-latest | ||
timeoutInMinutes: 360 | ||
strategy: | ||
matrix: | ||
Python39: | ||
python_version: '3.9' | ||
Python310: | ||
python_version: '3.10' | ||
Python311: | ||
python_version: '3.11' | ||
Python312: | ||
python_version: '3.12' | ||
steps: | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '$(python.version)' | ||
displayName: 'Use Python $(python.version)' | ||
|
||
- script: | | ||
python -m pip install --upgrade pip | ||
pip install .[all] | ||
displayName: 'Install dependencies' | ||
- script: | | ||
pip install pytest pytest-azurepipelines | ||
coverage run -m pytest # Run the tests and check for test coverage. | ||
coverage report -m # Generate test coverage report. | ||
displayName: 'pytest and coverage' | ||
- script: | | ||
make -C docs html # Build the documentation. | ||
displayName: 'make documentation' | ||
- job: MacOSTests | ||
pool: | ||
vmImage: macOS-latest | ||
timeoutInMinutes: 360 | ||
strategy: | ||
matrix: | ||
macos_python3.9: | ||
python.version: '3.9' | ||
|
||
steps: | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '$(python.version)' | ||
displayName: 'Use Python $(python.version)' | ||
|
||
- script: | | ||
python -m pip install --upgrade pip | ||
pip install .[all] | ||
displayName: 'Install dependencies' | ||
- script: | | ||
pip install pytest pytest-azurepipelines | ||
pytest | ||
displayName: 'pytest' | ||
- job: WindowsTests | ||
pool: | ||
vmImage: windows-latest | ||
timeoutInMinutes: 360 | ||
strategy: | ||
matrix: | ||
win_python3.9: | ||
python.version: '3.9' | ||
|
||
steps: | ||
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" | ||
displayName: Add conda to PATH | ||
|
||
- script: conda create --yes --quiet --name andesEnv | ||
displayName: Create Anaconda environment | ||
|
||
- script: | | ||
call activate andesEnv | ||
conda install --yes --quiet --name andesEnv python=%PYTHON_VERSION% | ||
displayName: Install Anaconda packages | ||
- script: | | ||
call activate andesEnv | ||
python -m pip install --upgrade pip | ||
pip install pytest pytest-azurepipelines | ||
pip install .[dev,interop] | ||
pytest | ||
displayName: pytest |