Skip to content

Commit

Permalink
first attempt at crossplat solution
Browse files Browse the repository at this point in the history
  • Loading branch information
scbedd committed Apr 28, 2021
1 parent 4aabe9e commit ba0e9dc
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions eng/pipelines/templates/steps/test-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,25 @@ steps:
versionSpec: $(PythonVersion)

- ${{ each artifact in parameters.CondaArtifacts }}:
- bash: |
- script: |
echo "##vso[task.prependpath]$CONDA/bin"
displayName: 'Prepend PATH with Conda and INIT'
- bash: |
- script: |
conda env create --name ${{ artifact.name }} --file $(Build.SourcesDirectory)/eng/conda_env.yml
conda install --name ${{ artifact.name }} --yes --quiet conda-build
source activate ${{ artifact.name }}
${{ if not(contains(parameters.OSVmImage, 'windows')) }}:
source activate ${{ artifact.name }}
${{ if contains(parameters.OSVmImage, 'windows') }}:
call activate ${{ artifact.name }}
conda index $(Build.ArtifactStagingDirectory)/${{ artifact.name }}
displayName: 'Prepare Conda Environment for Testing ${{ artifact.name }}, Index the Target Local Artifact'
- bash: |
source activate ${{ artifact.name }}
- script: |
${{ if not(contains(parameters.OSVmImage, 'windows')) }}:
source activate ${{ artifact.name }}
${{ if contains(parameters.OSVmImage, 'windows') }}:
call activate ${{ artifact.name }}
pip install -r eng/ci_tools.txt
displayName: 'Activate Conda Environment and Install General Dependencies ${{ artifact.name }}'
Expand All @@ -74,19 +80,21 @@ steps:
WorkingDirectory: "$(conda.build)"
SkipDefaultCheckout: true

- pwsh: |
Get-ChildItem $(conda.build) -R
displayName: 'Dump contents of the artifact staging directory'
- bash: |
source activate ${{ artifact.name }}
- script: |
${{ if not(contains(parameters.OSVmImage, 'windows')) }}:
source activate ${{ artifact.name }}
${{ if contains(parameters.OSVmImage, 'windows') }}:
call activate ${{ artifact.name }}
pip install -r dev_requirements.txt
conda install --name ${{ artifact.name }} ${{ artifact.name }} -c $(Build.ArtifactStagingDirectory)/${{ artifact.name }} --yes
displayName: 'Install ${{ checkout.package }} Conda Package and Dev Requirements'
workingDirectory: $(conda.build)/${{ checkout.checkout_path }}/${{ checkout.package }}
- bash: |
source activate ${{ artifact.name }}
- script: |
${{ if not(contains(parameters.OSVmImage, 'windows')) }}:
source activate ${{ artifact.name }}
${{ if contains(parameters.OSVmImage, 'windows') }}:
call activate ${{ artifact.name }}
pytest .
displayName: 'Run Tests for ${{ checkout.package }}'
workingDirectory: $(conda.build)/${{ checkout.checkout_path }}/${{ checkout.package }}

0 comments on commit ba0e9dc

Please sign in to comment.