Skip to content

Commit

Permalink
Add Azure Pipelines CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jinningwang committed Feb 24, 2024
1 parent af852d7 commit 0e07afe
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions .azure-pipelines/azure-pipelines.yml
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

0 comments on commit 0e07afe

Please sign in to comment.