diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e16fd36ac8f98..6aa78128f73fc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,6 +17,7 @@ pr: variables: PYTEST_WORKERS: auto + CONDA_CACHE_DIR: $(Pipeline.Workspace)\\.condarc jobs: # Mac and Linux use the same template diff --git a/ci/azure/windows.yml b/ci/azure/windows.yml index 05ba7c57ad6c4..fd256efe3e3ef 100644 --- a/ci/azure/windows.yml +++ b/ci/azure/windows.yml @@ -9,47 +9,62 @@ jobs: strategy: matrix: py38_np18: - ENV_FILE: ci/deps/azure-windows-38.yaml - CONDA_PY: "38" + ENV_FILE: ci\\deps\\azure-windows-38.yaml PATTERN: "not slow and not network" - PYTEST_WORKERS: 2 # GH-42236 py39: - ENV_FILE: ci/deps/azure-windows-39.yaml - CONDA_PY: "39" + ENV_FILE: ci\\deps\\azure-windows-39.yaml PATTERN: "not slow and not network and not high_memory" - PYTEST_WORKERS: 2 # GH-42236 steps: - powershell: | Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" - Write-Host "##vso[task.prependpath]$HOME/miniconda3/bin" - displayName: 'Add conda to PATH' - - script: conda update -q -n base conda - displayName: 'Update conda' - - - bash: | - conda env create -q --file ci\\deps\\azure-windows-$(CONDA_PY).yaml - displayName: 'Create anaconda environment' - - bash: | - source activate pandas-dev - conda list - python setup.py build_ext -q -j 4 - python -m pip install --no-build-isolation -e . - displayName: 'Build' - - bash: | - source activate pandas-dev - ci/run_tests.sh - displayName: 'Test' + displayName: Add conda to PATH + + - script: | + conda update --quiet --yes conda + displayName: Update conda + + - task: Cache@2 + displayName: Use cached Anaconda environment + inputs: + key: 'conda | "$(Agent.OS)" | "$(ENV_FILE)"' + restoreKeys: | + python | "$(Agent.OS)" + python + path: $(CONDA_CACHE_DIR) + cacheHitVar: CONDA_CACHE_RESTORED + + - script: | + conda env create -q --file $(ENV_FILE) + displayName: Create Anaconda environment + condition: eq(variables.CONDA_CACHE_RESTORED, 'false') + + - script: | + call activate pandas-dev + python setup.py build_ext -q -j 2 + python -m pip install -e . --no-build-isolation --no-use-pep517 + displayName: Build pandas + + - script: | + call activate pandas-dev + sh ci/run_tests.sh + displayName: Test + + - script: | + call activate pandas-dev + python -c "import pandas; pandas.show_versions();" + displayName: Build versions + - task: PublishTestResults@2 condition: succeededOrFailed() inputs: failTaskOnFailedTests: true testResultsFiles: 'test-data.xml' - testRunTitle: ${{ format('{0}-$(CONDA_PY)', parameters.name) }} - displayName: 'Publish test results' + testRunTitle: ${{ format('{0}-$(ENV_FILE)', parameters.name) }} + displayName: Publish test results - - bash: | - source activate pandas-dev + - script: | + call activate pandas-dev python ci/print_skipped.py - displayName: 'Print skipped tests' + displayName: Print skipped tests