-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
109 lines (102 loc) · 3.56 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
schedules:
- cron: "0 13 * * *"
displayName: Nightly build
branches:
include:
- master
- develop
jobs:
- job: 'tox'
variables:
python.version: '3.12'
TOXENV: 'py312'
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macos-latest'
windows:
imageName: 'windows-latest'
pool:
vmImage: $(imageName)
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
inputs:
versionSpec: '$(python.version)'
- script: python -m pip install --upgrade pip && python -m pip install tox
displayName: 'Install Tox'
- script: tox -e $(TOXENV)
displayName: 'Run Tox tests'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
condition: succeededOrFailed()
- task: PublishCodeCoverageResults@2
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
# reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
- job: 'docs'
condition: and(ne(variables['Build.Reason'], 'PullRequest'), ne(variables['Build.Reason'], 'Schedule')) # Skip if it's a PR build or a scheduled build
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
displayName: 'Select python version'
inputs:
versionSpec: '3.12'
- script: |
sudo apt install pandoc -y
displayName: 'Install pandoc'
- script: |
python -m pip install wheel
python -m pip install -e .
python -m pip install -r requirements.txt
python -m pip install --upgrade sphinx-rtd-theme
displayName: 'Install Python dependencies'
- script: |
mkdir doc_build
python -m sphinx.cmd.build "docs" "doc_build/$(Build.SourceBranchName)" -j2
displayName: 'Build documentation'
# Invoke directly with `python -m sphinx.cmd.build` instead of `sphinx-build` to avoid "sphinx-build: command not found" on Azure
- script: |
git clone --depth 1 https://github.com/atomicateam/docs doc_repo
rm -rf doc_repo/$(Build.SourceBranchName)
mv doc_build/$(Build.SourceBranchName) doc_repo/$(Build.SourceBranchName)
git -C doc_repo config user.email ci@azurepipelines
git -C doc_repo config user.name "Azure Pipelines"
git -C doc_repo add .
git -C doc_repo commit -m "Automatic update"
git -C doc_repo push https://$(GithubToken)@github.com/atomicateam/docs
displayName: 'Publish site'
# - publish: docs/_build
# artifact: docs
# displayName: 'Publish documentation as Azure zip file'
- job: 'deploy'
dependsOn: 'tox'
condition: and(ne(variables['Build.Reason'], 'Schedule'),and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
displayName: 'Select python version'
inputs:
versionSpec: '3.12'
- script: |
python -m pip install setuptools
python -m pip install wheel
python -m pip install twine
python setup.py build
python setup.py sdist
python setup.py bdist_wheel
displayName: 'Build Atomica'
- task: TwineAuthenticate@1
displayName: 'Twine Authenticate'
inputs:
pythonUploadServiceConnection: pypi_atomica
- script: |
python -m twine upload -r "pypi_atomica" --config-file $(PYPIRC_PATH) dist/*
displayName: 'Upload to PyPI'