-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
CI: Enhance error handling in Azure Pipelines #26335
Open
morkev
wants to merge
2
commits into
numpy:main
Choose a base branch
from
morkev:main
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
trigger: | ||
# start a new build for every push | ||
batch: False | ||
branches: | ||
include: | ||
- main | ||
- maintenance/* | ||
|
||
|
||
pr: | ||
branches: | ||
include: | ||
- '*' # must quote since "*" is a YAML reserved character; we want a string | ||
|
||
- '*' # All branches for PRs | ||
|
||
stages: | ||
|
||
|
@@ -36,7 +33,6 @@ stages: | |
condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) | ||
dependsOn: Check | ||
jobs: | ||
|
||
- job: Lint | ||
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) | ||
pool: | ||
|
@@ -50,8 +46,7 @@ stages: | |
- script: >- | ||
python -m pip install -r requirements/linter_requirements.txt | ||
displayName: 'Install tools' | ||
# pip 21.1 emits a pile of garbage messages to annoy users :) | ||
# failOnStderr: true | ||
continueOnError: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand. How can the lint job succeed if the tools are not installed? |
||
- script: | | ||
python tools/linter.py --branch origin/$(System.PullRequest.TargetBranch) | ||
displayName: 'Run Lint Checks' | ||
|
@@ -65,11 +60,11 @@ stages: | |
git submodule update --init | ||
displayName: 'Fetch submodules' | ||
- script: | | ||
# yum does not have a ninja package, so use the PyPI one | ||
docker run -v $(pwd):/numpy -e CFLAGS="-msse2 -std=c99 -UNDEBUG" \ | ||
-e F77=gfortran-5 -e F90=gfortran-5 quay.io/pypa/manylinux2014_i686 \ | ||
/bin/bash -xc "source /numpy/tools/ci/run_32_bit_linux_docker.sh" | ||
displayName: 'Run 32-bit manylinux2014 Docker Build / Tests' | ||
continueOnError: true # Consider whether to allow continuation on error | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems wrong. If the tests fail, the job should fail |
||
|
||
- job: Windows | ||
timeoutInMinutes: 120 | ||
|
@@ -78,23 +73,23 @@ stages: | |
strategy: | ||
maxParallel: 3 | ||
matrix: | ||
Python310-64bit-fast: | ||
PYTHON_VERSION: '3.10' | ||
PYTHON_ARCH: 'x64' | ||
TEST_MODE: fast | ||
BITS: 64 | ||
Python311-64bit-full: | ||
PYTHON_VERSION: '3.11' | ||
PYTHON_ARCH: 'x64' | ||
TEST_MODE: full | ||
BITS: 64 | ||
_USE_BLAS_ILP64: '1' | ||
PyPy310-64bit-fast: | ||
PYTHON_VERSION: 'pypy3.10' | ||
PYTHON_ARCH: 'x64' | ||
TEST_MODE: fast | ||
BITS: 64 | ||
_USE_BLAS_ILP64: '1' | ||
Python310-64bit-fast: | ||
PYTHON_VERSION: '3.10' | ||
PYTHON_ARCH: 'x64' | ||
TEST_MODE: fast | ||
BITS: 64 | ||
Python311-64bit-full: | ||
PYTHON_VERSION: '3.11' | ||
PYTHON_ARCH: 'x64' | ||
TEST_MODE: full | ||
BITS: 64 | ||
_USE_BLAS_ILP64: '1' | ||
PyPy310-64bit-fast: | ||
PYTHON_VERSION: 'pypy3.10' | ||
PYTHON_ARCH: 'x64' | ||
TEST_MODE: fast | ||
BITS: 64 | ||
_USE_BLAS_ILP64: '1' | ||
|
||
steps: | ||
- template: azure-steps-windows.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,89 @@ | ||
steps: | ||
- script: git submodule update --init | ||
displayName: 'Fetch submodules' | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: $(PYTHON_VERSION) | ||
addToPath: true | ||
architecture: $(PYTHON_ARCH) | ||
|
||
- script: python -m pip install --upgrade pip wheel | ||
displayName: 'Install tools' | ||
|
||
- script: python -m pip install -r requirements/test_requirements.txt | ||
displayName: 'Install dependencies; some are optional to avoid test skips' | ||
|
||
- powershell: | | ||
choco install -y --stoponfirstfailure --checksum 6004DF17818F5A6DBF19CB335CC92702 pkgconfiglite | ||
displayName: 'Install utilities' | ||
|
||
- powershell: | | ||
# Note: ensure the `pip install .` command remains the last one here, | ||
# to avoid "green on failure" issues | ||
If ( Test-Path env:DISABLE_BLAS ) { | ||
python -m pip install . -v -Csetup-args="--vsenv" -Csetup-args="-Dblas=none" -Csetup-args="-Dlapack=none" -Csetup-args="-Dallow-noblas=true" | ||
} | ||
elseif ( Test-Path env:_USE_BLAS_ILP64 ) { | ||
pip install -r requirements/ci_requirements.txt | ||
spin config-openblas --with-scipy-openblas=64 | ||
$env:PKG_CONFIG_PATH="$pwd/.openblas" | ||
python -m pip install . -v -Csetup-args="--vsenv" | ||
} else { | ||
pip install -r requirements/ci_requirements.txt | ||
spin config-openblas --with-scipy-openblas=32 | ||
$env:PKG_CONFIG_PATH="$pwd/.openblas" | ||
python -m pip install . -v -Csetup-args="--vsenv" | ||
} | ||
displayName: 'Build NumPy' | ||
|
||
- powershell: | | ||
cd tools # avoid root dir to not pick up source tree | ||
# Get a gfortran onto the path for f2py tests | ||
$env:PATH = "c:\\rtools43\\x86_64-w64-mingw32.static.posix\\bin;$env:PATH" | ||
If ( $env:TEST_MODE -eq "full" ) { | ||
pytest --pyargs numpy -rsx --junitxml=junit/test-results.xml | ||
} else { | ||
pytest --pyargs numpy -m "not slow" -rsx --junitxml=junit/test-results.xml | ||
} | ||
displayName: 'Run NumPy Test Suite' | ||
|
||
- task: PublishTestResults@2 | ||
condition: succeededOrFailed() | ||
inputs: | ||
testResultsFiles: '**/test-*.xml' | ||
failTaskOnFailedTests: true | ||
testRunTitle: 'Publish test results for Python $(PYTHON_VERSION) $(BITS)-bit $(TEST_MODE) Windows' | ||
trigger: | ||
branches: | ||
include: | ||
- main | ||
- features/* | ||
- bugfix/* | ||
|
||
stages: | ||
- stage: Initialize | ||
jobs: | ||
- job: Setup | ||
pool: | ||
vmImage: 'windows-2019' | ||
steps: | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: $(PYTHON_VERSION) | ||
addToPath: true | ||
architecture: $(PYTHON_ARCH) | ||
|
||
- script: git submodule update --init | ||
displayName: 'Fetch submodules' | ||
|
||
- task: Cache@2 | ||
inputs: | ||
key: 'pip | "$(Agent.OS)" | requirements/test_requirements.txt' | ||
restoreKeys: 'pip | "$(Agent.OS)"' | ||
path: $(PIP_CACHE_DIR) | ||
displayName: 'Cache pip packages' | ||
|
||
- script: | | ||
python -m pip install --upgrade pip wheel | ||
python -m pip install -r requirements/test_requirements.txt | ||
displayName: 'Install tools and dependencies' | ||
|
||
- powershell: | | ||
choco install -y --stoponfirstfailure pkgconfiglite | ||
displayName: 'Install utilities' | ||
|
||
- powershell: | | ||
If (Test-Path env:DISABLE_BLAS) { | ||
python -m pip install . -v -Csetup-args="--vsenv" -Csetup-args="-Dblas=none" -Csetup-args="-Dlapack=none" -Csetup-args="-Dallow-noblas=true" | ||
} | ||
elseif (Test-Path env:_USE_BLAS_ILP64) { | ||
pip install -r requirements/ci_requirements.txt | ||
spin config-openblas --with-scipy-openblas=64 | ||
$env:PKG_CONFIG_PATH="$pwd/.openblas" | ||
python -m pip install . -v -Csetup-args="--vsenv" | ||
} else { | ||
pip install -r requirements/ci_requirements.txt | ||
spin config-openblas --with-scipy-openblas=32 | ||
$env:PKG_CONFIG_PATH="$pwd/.openblas" | ||
python -m pip install . -v -Csetup-args="--vsenv" | ||
} | ||
displayName: 'Build NumPy' | ||
|
||
- stage: Test | ||
dependsOn: Initialize | ||
jobs: | ||
- job: Testing | ||
pool: | ||
vmImage: 'windows-2019' | ||
steps: | ||
- powershell: | | ||
cd tools | ||
$env:PATH = "c:\\rtools43\\x86_64-w64-mingw32.static.posix\\bin;$env:PATH" | ||
If ($env:TEST_MODE -eq "full") { | ||
Try { | ||
pytest --pyargs numpy -rsx --junitxml=junit/test-results.xml | ||
} Catch { | ||
Write-Host "Error during testing: $_" | ||
Exit 1 | ||
} | ||
} else { | ||
Try { | ||
pytest --pyargs numpy -m "not slow" -rsx --junitxml=junit/test-results.xml | ||
} Catch { | ||
Write-Host "Error during testing: $_" | ||
Exit 1 | ||
} | ||
} | ||
displayName: 'Run NumPy Test Suite' | ||
|
||
- task: PublishTestResults@2 | ||
condition: succeededOrFailed() | ||
inputs: | ||
testResultsFiles: '**/test-*.xml' | ||
failTaskOnFailedTests: true | ||
testRunTitle: 'Publish test results for Python $(PYTHON_VERSION) $(BITS)-bit $(TEST_MODE) Windows' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unindent?