8000 CI Adds skipping to azure pipelines with commit message by thomasjpfan · Pull Request #19134 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

CI Adds skipping to azure pipelines with commit message #19134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 71 additions & 46 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,66 +8,65 @@ schedules:
always: true

jobs:
- job: linting
displayName: Linting
- job: git_commit
displayName: Get Git Commit
pool:
vmImage: ubuntu-18.04
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
- bash: |
pip install flake8 mypy==0.782
displayName: Install linters
- bash: |
set -ex
if [[ $BUILD_REASON == "PullRequest" ]]; then
# By default pull requests use refs/pull/PULL_ID/merge as the source branch
# which has a "Merge ID into ID" as a commit message. The latest commit
# message is the second to last commit
COMMIT_ID=$(echo $BUILD_SOURCEVERSIONMESSAGE | awk '{print $2}')
COMMIT_MESSAGE=$(git log $COMMIT_ID -1 --pretty=%B)
message=$(git log $COMMIT_ID -1 --pretty=%B)
else
COMMIT_MESSAGE=$BUILD_SOURCEVERSIONMESSAGE
message=$BUILD_SOURCEVERSIONMESSAGE
fi
echo "##vso[task.setvariable variable=COMMIT_MESSAGE]$COMMIT_MESSAGE"
echo "##vso[task.setvariable variable=message;isOutput=true]$message"
name: commit
displayName: Get source version message

- job: linting
dependsOn: [git_commit]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[lint skip]')),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
)
displayName: Linting
pool:
vmImage: ubuntu-18.04
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
- bash: |
set -ex
if [[ "$COMMIT_MESSAGE" =~ "[lint skip]" ]]; then
# skip linting
echo "Skipping flake8 linting"
exit 0
else
./build_tools/circle/linting.sh
fi
pip install flake8 mypy==0.782
displayName: Install linters
- bash: |
./build_tools/circle/linting.sh
displayName: Run linting
- bash: |
set -ex
if [[ "$COMMIT_MESSAGE" =~ "[lint skip]" ]]; then
# skip linting
echo "Skipping mypy linting"
exit 0
else
mypy sklearn/
fi
mypy sklearn/
displayName: Run mypy
- bash: |
if [[ "$COMMIT_MESSAGE" =~ "[scipy-dev]" ]] || [[ $BUILD_REASON == "Schedule" ]]; then
echo "Running scipy-dev"
echo "##vso[task.setvariable variable=runScipyDev;isOutput=true]true"
else
echo "##vso[task.setvariable variable=runScipyDev;isOutput=true]false"
fi
name: gitCommitMessage
displayName: Determine to run scipy-dev

- template: build_tools/azure/posix.yml
parameters:
name: Linux_Nightly
vmImage: ubuntu-18.04
dependsOn: [linting]
condition: eq(dependencies['linting']['outputs']['gitCommitMessage.runScipyDev'], 'true')
dependsOn: [git_commit, linting]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
or(eq(variables['Build.Reason'], 'Schedule'),
contains(dependencies['git_commit']['outputs']['commit.message'], '[scipy-dev]'
)
)
)
matrix:
pylatest_pip_scipy_dev:
DISTRIB: 'conda-pip-scipy-dev'
Expand All @@ -84,6 +83,12 @@ jobs:
parameters:
name: Linux_Runs
vmImage: ubuntu-18.04
dependsOn: [git_commit]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
)
matrix:
pylatest_conda_mkl:
DISTRIB: 'conda'
Expand All @@ -95,8 +100,13 @@ jobs:
parameters:
name: Linux
vmImage: ubuntu-18.04
dependsOn: [linting]
condition: and(ne(variables['Build.Reason'], 'Schedule'), succeeded('linting'))
dependsOn: [linting, git_commit]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
ne(variables['Build.Reason'], 'Schedule')
)
matrix:
# Linux environment to test that scikit-learn can be built against
# versions of numpy, scipy with ATLAS that comes with Ubuntu Bionic 18.04
Expand Down Expand Up @@ -139,8 +149,13 @@ jobs:
parameters:
name: Linux32
vmImage: ubuntu-18.04
dependsOn: [linting]
condition: and(ne(variables['Build.Reason'], 'Schedule'), succeeded('linting'))
dependsOn: [linting, git_commit]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
ne(variables['Build.Reason'], 'Schedule')
)
matrix:
py36_ubuntu_atlas_32bit:
DISTRIB: 'ubuntu-32'
Expand All @@ -157,8 +172,13 @@ jobs:
parameters:
name: macOS
vmImage: macOS-10.14
dependsOn: [linting]
condition: and(ne(variables['Build.Reason'], 'Schedule'), succeeded('linting'))
dependsOn: [linting, git_commit]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
ne(variable 76AD s['Build.Reason'], 'Schedule')
)
matrix:
pylatest_conda_forge_mkl:
DISTRIB: 'conda'
Expand All @@ -174,8 +194,13 @@ jobs:
parameters:
name: Windows
vmImage: vs2017-win2016
dependsOn: [linting]
condition: and(ne(variables['Build.Reason'], 'Schedule'), succeeded('linting'))
dependsOn: [linting, git_commit]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
ne(variables['Build.Reason'], 'Schedule')
)
matrix:
py37_conda_mkl:
PYTHON_VERSION: '3.7'
Expand Down
0