Add publish yml for azure pipeline

This commit is contained in:
Luna Zheng 2023-07-11 10:39:51 +08:00
Родитель f7c12826f2
Коммит 364d83a01c
3 изменённых файлов: 59 добавлений и 61 удалений

Просмотреть файл

@ -0,0 +1,59 @@
jobs:
- job: "Test"
pool:
vmImage: "macOS-latest"
strategy:
matrix:
Python38:
python.version: "3.8"
Python39:
python.version: "3.9"
Python310:
python.version: "3.10"
Python311:
python.version: "3.11"
maxParallel: 4
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "$(python.version)"
architecture: "x64"
- script: curl -sSL https://install.python-poetry.org | python3 -
displayName: Install Poetry
- script: |
$HOME/.local/bin/poetry install
displayName: "Install dependencies"
- script: |
$HOME/.local/bin/poetry run pylint --rcfile=pylintrc xcodeproj
$HOME/.local/bin/poetry run pylint --rcfile=pylintrc tests
displayName: "Lint"
- script: |
$HOME/.local/bin/poetry run mypy --ignore-missing-imports xcodeproj/
$HOME/.local/bin/poetry run mypy --ignore-missing-imports tests/
displayName: "Type Check"
- script: |
$HOME/.local/bin/poetry run pytest tests --cov=xcodeproj --cov-report html --cov-report xml --doctest-modules --junitxml=junit/test-results.xml
displayName: "pytest"
- script: |
$HOME/.local/bin/poetry run python inlinecss.py htmlcov
displayName: "Inline CSS"
- task: PublishTestResults@2
inputs:
testResultsFiles: "**/test-results.xml"
testRunTitle: "Python $(python.version)"
condition: succeededOrFailed()
# Publish Code Coverage Results
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: "cobertura"
summaryFileLocation: $(System.DefaultWorkingDirectory)/coverage.xml
reportDirectory: $(System.DefaultWorkingDirectory)/htmlcov

Просмотреть файл

Просмотреть файл

@ -1,61 +0,0 @@
jobs:
- job: 'Test'
pool:
vmImage: 'macOS-latest'
strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
maxParallel: 4
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: curl -sSL https://install.python-poetry.org | python3 -
displayName: Install Poetry
- script: |
$HOME/.local/bin/poetry install
displayName: 'Install dependencies'
- script: |
$HOME/.local/bin/poetry run pylint --rcfile=pylintrc xcodeproj
$HOME/.local/bin/poetry run pylint --rcfile=pylintrc tests
displayName: 'Lint'
- script: |
$HOME/.local/bin/poetry run mypy --ignore-missing-imports xcodeproj/
$HOME/.local/bin/poetry run mypy --ignore-missing-imports tests/
displayName: 'Type Check'
- script: |
$HOME/.local/bin/poetry run pytest tests --cov=xcodeproj --cov-report html --cov-report xml --doctest-modules --junitxml=junit/test-results.xml
displayName: 'pytest'
- script: |
$HOME/.local/bin/poetry run python inlinecss.py htmlcov
displayName: 'Inline CSS'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
# Publish Code Coverage Results
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: $(System.DefaultWorkingDirectory)/coverage.xml
reportDirectory: $(System.DefaultWorkingDirectory)/htmlcov