title: Share the same workspace across different jobs
body: <p>Can I share the same workspace installed in one job among other jobs?</p>
  
  <p>In particular, I want to keep share the software installed in one job to later jobs. According to the <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&amp;tabs=yaml#workspace" rel="nofollow noreferrer">documentation</a>,</p>
  
  <blockquote>
    <p>When you run a pipeline on a self-hosted agent, by default, none of the sub-directories are cleaned in between two consecutive runs.</p>
  </blockquote>
  
  <p>However, this pipeline below failed in job <em>J2</em> because the <code>sphinx</code> installed in job <em>J1</em> is lost in <em>J2</em>.</p>
  
  <pre class="lang-yaml prettyprint-override"><code>jobs:
  - job: 'J1'
    pool:
      vmImage: 'Ubuntu-16.04'
    strategy:
      matrix:
        Python37:
          python.version: '3.7'
      maxParallel: 3
  
    steps:
    - task: UsePythonVersion@0
      inputs:
        versionSpec: '$(python.version)'
        architecture: 'x64'
    - script: python -m pip install --upgrade pip
      displayName: 'Install dependencies'
    - script: pip install --upgrade pip
      displayName: 'Update pip'
    - script: |
        echo "Publishing document for development version $(Build.BuildId)"
        pip install -U sphinx
      displayName: 'TEST J1'
    - script: |
        echo "TEST SPHINX"
        sphinx-build --help
      displayName: 'TEST SPHINX'
  
  - job: 'J2'
    dependsOn: 'J1'
  
    steps:
    - task: UsePythonVersion@0
      inputs:
        versionSpec: '3.x'
        architecture: 'x64'
  
    - script: |
        echo "TEST SPHINX"
        sphinx-build --help
      displayName: 'TEST SPHINX'
  
  </code></pre>