Skip to content

Commit

Permalink
CI Uses bash instead of batch on Azure Windows jobs (scikit-learn#20715)
Browse files Browse the repository at this point in the history
Co-authored-by: Olivier Grisel <[email protected]>
  • Loading branch information
thomasjpfan and ogrisel authored Aug 9, 2021
1 parent 5088a40 commit adae279
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 88 deletions.
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ jobs:
PYTHON_ARCH: '64'
PYTEST_VERSION: '*'
COVERAGE: 'true'
DISTRIB: 'conda'
py37_pip_openblas_32bit:
PYTHON_VERSION: '3.7'
PYTHON_ARCH: '32'
45 changes: 0 additions & 45 deletions build_tools/azure/install.cmd

This file was deleted.

37 changes: 37 additions & 0 deletions build_tools/azure/install_win.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

set -e
set -x

if [[ "$PYTHON_ARCH" == "64" ]]; then
conda create -n $VIRTUALENV -q -y python=$PYTHON_VERSION numpy scipy cython matplotlib wheel pillow joblib

source activate $VIRTUALENV

pip install threadpoolctl

if [[ "$PYTEST_VERSION" == "*" ]]; then
pip install pytest
else
pip install pytest==$PYTEST_VERSION
fi
else
pip install numpy scipy cython pytest wheel pillow joblib threadpoolctl
fi

if [[ "$PYTEST_XDIST_VERSION" != "none" ]]; then
pip install pytest-xdist
fi

if [[ "$COVERAGE" == "true" ]]; then
pip install coverage codecov pytest-cov
fi

python --version
pip --version

# Build scikit-learn
python setup.py bdist_wheel

# Install the generated wheel package to test it
pip install --pre --no-index --find-links dist scikit-learn
24 changes: 0 additions & 24 deletions build_tools/azure/test_script.cmd

This file was deleted.

10 changes: 0 additions & 10 deletions build_tools/azure/upload_codecov.cmd

This file was deleted.

16 changes: 7 additions & 9 deletions build_tools/azure/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ jobs:
SKLEARN_SKIP_NETWORK_TESTS: '1'
PYTEST_VERSION: '5.2.1'
PYTEST_XDIST: 'true'
TMP_FOLDER: '$(Agent.WorkFolder)\tmp_folder'
PYTEST_XDIST_VERSION: 'latest'
TEST_DIR: '$(Agent.WorkFolder)/tmp_folder'
strategy:
matrix:
${{ insert }}: ${{ parameters.matrix }}

steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
- bash: echo "##vso[task.prependpath]$CONDA/Scripts"
displayName: Add conda to PATH for 64 bit Python
condition: eq(variables['PYTHON_ARCH'], '64')
- task: UsePythonVersion@0
Expand All @@ -34,21 +35,18 @@ jobs:
architecture: 'x86'
displayName: Use 32 bit System Python
condition: eq(variables['PYTHON_ARCH'], '32')
- script: |
build_tools\\azure\\install.cmd
- bash: ./build_tools/azure/install_win.sh
displayName: 'Install'
- script: |
build_tools\\azure\\test_script.cmd
- bash: ./build_tools/azure/test_script.sh
displayName: 'Test Library'
- script: |
build_tools\\azure\\upload_codecov.cmd
- bash: ./build_tools/azure/upload_codecov.sh
condition: and(succeeded(), eq(variables['COVERAGE'], 'true'))
displayName: 'Upload To Codecov'
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
- task: PublishTestResults@2
inputs:
testResultsFiles: '$(TMP_FOLDER)\$(JUNITXML)'
testResultsFiles: '$(TEST_DIR)/$(JUNITXML)'
testRunTitle: ${{ format('{0}-$(Agent.JobName)', parameters.name) }}
displayName: 'Publish Test Results'
condition: succeededOrFailed()

0 comments on commit adae279

Please sign in to comment.