我有一个包含 2 个目录的存储库,一个带有 python 代码,一个带有 C 代码。仅当 python 文件夹(hello_app)中的文件发生更改时,我才想在所有 PR 上运行一个管道。我使用了以下 yaml 文件,但当新 PR 包含 hello_app 目录之外的更改(仅)时,管道仍会运行:
trigger:
- none
pr:
branches:
include:
- master
paths:
exclude:
- '*'
include:
- hello_app/*
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python27:
python.version: '2.7'
Python36:
python.version: '3.6'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'
- script: |
python -m pip install --upgrade pip
pip install -r requirements.txt
displayName: 'Install dependencies'
- script: |
python -m pip install flake8
flake8 .
displayName: 'Run linter tests'
- script: |
pip install pytest pytest-azurepipelines
pytest
displayName: 'pytest'
我试图在线搜索,但似乎这应该工作。我使用的 yaml 有问题吗?
