Skip to content

Commit adae279

Browse files
thomasjpfanogrisel
andauthored
CI Uses bash instead of batch on Azure Windows jobs (scikit-learn#20715)
Co-authored-by: Olivier Grisel <[email protected]>
1 parent 5088a40 commit adae279

File tree

6 files changed

+45
-88
lines changed

6 files changed

+45
-88
lines changed

azure-pipelines.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ jobs:
242242
PYTHON_ARCH: '64'
243243
PYTEST_VERSION: '*'
244244
COVERAGE: 'true'
245+
DISTRIB: 'conda'
245246
py37_pip_openblas_32bit:
246247
PYTHON_VERSION: '3.7'
247248
PYTHON_ARCH: '32'

build_tools/azure/install.cmd

Lines changed: 0 additions & 45 deletions
This file was deleted.

build_tools/azure/install_win.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
if [[ "$PYTHON_ARCH" == "64" ]]; then
7+
conda create -n $VIRTUALENV -q -y python=$PYTHON_VERSION numpy scipy cython matplotlib wheel pillow joblib
8+
9+
source activate $VIRTUALENV
10+
11+
pip install threadpoolctl
12+
13+
if [[ "$PYTEST_VERSION" == "*" ]]; then
14+
pip install pytest
15+
else
16+
pip install pytest==$PYTEST_VERSION
17+
fi
18+
else
19+
pip install numpy scipy cython pytest wheel pillow joblib threadpoolctl
20+
fi
21+
22+
if [[ "$PYTEST_XDIST_VERSION" != "none" ]]; then
23+
pip install pytest-xdist
24+
fi
25+
26+
if [[ "$COVERAGE" == "true" ]]; then
27+
pip install coverage codecov pytest-cov
28+
fi
29+
30+
python --version
31+
pip --version
32+
33+
# Build scikit-learn
34+
python setup.py bdist_wheel
35+
36+
# Install the generated wheel package to test it
37+
pip install --pre --no-index --find-links dist scikit-learn

build_tools/azure/test_script.cmd

Lines changed: 0 additions & 24 deletions
This file was deleted.

build_tools/azure/upload_codecov.cmd

Lines changed: 0 additions & 10 deletions
This file was deleted.

build_tools/azure/windows.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ jobs:
1818
SKLEARN_SKIP_NETWORK_TESTS: '1'
1919
PYTEST_VERSION: '5.2.1'
2020
PYTEST_XDIST: 'true'
21-
TMP_FOLDER: '$(Agent.WorkFolder)\tmp_folder'
21+
PYTEST_XDIST_VERSION: 'latest'
22+
TEST_DIR: '$(Agent.WorkFolder)/tmp_folder'
2223
strategy:
2324
matrix:
2425
${{ insert }}: ${{ parameters.matrix }}
2526

2627
steps:
27-
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
28+
- bash: echo "##vso[task.prependpath]$CONDA/Scripts"
2829
displayName: Add conda to PATH for 64 bit Python
2930
condition: eq(variables['PYTHON_ARCH'], '64')
3031
- task: UsePythonVersion@0
@@ -34,21 +35,18 @@ jobs:
3435
architecture: 'x86'
3536
displayName: Use 32 bit System Python
3637
condition: eq(variables['PYTHON_ARCH'], '32')
37-
- script: |
38-
build_tools\\azure\\install.cmd
38+
- bash: ./build_tools/azure/install_win.sh
3939
displayName: 'Install'
40-
- script: |
41-
build_tools\\azure\\test_script.cmd
40+
- bash: ./build_tools/azure/test_script.sh
4241
displayName: 'Test Library'
43-
- script: |
44-
build_tools\\azure\\upload_codecov.cmd
42+
- bash: ./build_tools/azure/upload_codecov.sh
4543
condition: and(succeeded(), eq(variables['COVERAGE'], 'true'))
4644
displayName: 'Upload To Codecov'
4745
env:
4846
CODECOV_TOKEN: $(CODECOV_TOKEN)
4947
- task: PublishTestResults@2
5048
inputs:
51-
testResultsFiles: '$(TMP_FOLDER)\$(JUNITXML)'
49+
testResultsFiles: '$(TEST_DIR)/$(JUNITXML)'
5250
testRunTitle: ${{ format('{0}-$(Agent.JobName)', parameters.name) }}
5351
displayName: 'Publish Test Results'
5452
condition: succeededOrFailed()

0 commit comments

Comments
 (0)