-
-
Notifications
You must be signed in to change notification settings - Fork 301
/
integration-jobs.yml
102 lines (102 loc) · 3.48 KB
/
integration-jobs.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
jobs:
- job: test
variables:
IMAGE: ubuntu-20.04
TOXENV: py
PYTEST_ADDOPTS: --numprocesses 4
BRANCH_NAME: $(Build.SourceBranch)
strategy:
matrix:
linux-python-3.7:
PYTHON_VERSION: 3.7
linux-python-3.10-light:
PYTHON_VERSION: 3.10
TOXENV: light
linux-python-3.10-cover:
PYTHON_VERSION: 3.10
TOXENV: cover
linux-lint:
PYTHON_VERSION: 3.10
TOXENV: lint
linux-mypy:
PYTHON_VERSION: 3.10
TOXENV: mypy
macos-python-3.7:
IMAGE: macos-11
PYTHON_VERSION: 3.7
macos-python-3.10:
IMAGE: macos-11
PYTHON_VERSION: 3.10
windows-python-3.7:
IMAGE: windows-2019
PYTHON_VERSION: 3.7
windows-python-3.10:
IMAGE: windows-2019
PYTHON_VERSION: 3.10
pool:
vmImage: $(IMAGE)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(PYTHON_VERSION)
addToPath: true
displayName: Enable the targeted python version
- script: python -m pip install -U tox poetry
displayName: Install required runtime dependencies
- script: python -m tox
displayName: Execute tests through tox
- script: |
python -m pip install coveralls
coveralls
condition: and(eq(variables['TOXENV'], 'cover'), eq(variables['Build.DefinitionName'], 'main'))
env:
COVERALLS_SERVICE_NAME: azure-pipelines
COVERALLS_REPO_TOKEN: $(coveralls_repo_token)
displayName: Publish coverage reports (Coveralls)
- task: PublishCodeCoverageResults@1
condition: eq(variables['TOXENV'], 'cover')
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
displayName: Publish coverage reports (Azure Pipelines)
- task: PublishTestResults@2
condition: ne(variables['TOXENV'], 'lint')
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(PYTHON_VERSION) on $(IMAGE)'
displayName: Publish tests reports
- job: package
strategy:
matrix:
linux:
IMAGE: ubuntu-20.04
TARGET_TRIPLE: x86_64-unknown-linux-gnu
macos:
IMAGE: macos-11
TARGET_TRIPLE: x86_64-apple-darwin
windows:
IMAGE: windows-2019
TARGET_TRIPLE: x86_64-pc-windows-msvc
pool:
vmImage: $(IMAGE)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: 3.10
addToPath: true
displayName: Enable the targeted python version
- script: python -m pip install -U tox poetry
displayName: Install required runtime dependencies
- script: |
set -e
poetry install
poetry run pyoxidizer build --release
displayName: Build Lexicon executable
- publish: $(System.DefaultWorkingDirectory)/build/$(TARGET_TRIPLE)/release/install
artifact: executable-$(TARGET_TRIPLE)
- job: trigger_readthedoc
pool:
vmImage: ubuntu-20.04
steps:
- bash: curl -X POST -d "branches=`echo "refs/tags/$(Build.SourceBranchName)" | sed 's|refs/.*/||g'`" -d "token=$(RTD_TOKEN)" $(RTD_URL)
condition: or(and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.DefinitionName'], 'main')), eq(variables['Build.DefinitionName'], 'release'))