• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Download PyTest cache
2
3description: Downloads the pytest cache to S3
4
5inputs:
6  cache_dir:
7    description: Path to the pytest cache directory, relative to $GITHUB_WORKSPACE. This is where the merged cache will be placed.
8    required: true
9  job_identifier:
10    description: Text that uniquely identifies a given job type within a workflow. All shards of a job should share the same job identifier.
11    required: true
12  s3_bucket:
13    description: S3 bucket to download PyTest cache
14    required: false
15    default: "gha-artifacts"
16
17runs:
18  using: composite
19  steps:
20    - uses: nick-fields/retry@v3.0.0
21      name: Setup dependencies
22      with:
23        shell: bash
24        timeout_minutes: 5
25        max_attempts: 5
26        retry_wait_seconds: 30
27        command: |
28          set -eu
29          python3 -m pip install boto3==1.19.12
30
31    - name: Download the cache
32      shell: bash
33      env:
34        CACHE_DIR: ${{ inputs.cache_dir }}
35        JOB_IDENTIFIER: ${{ inputs.job_identifier }}
36        REPO: ${{ github.repository }}
37        BUCKET: ${{ inputs.s3_bucket }}
38      run: |
39        python3 .github/scripts/pytest_cache.py \
40          --download \
41          --cache_dir $GITHUB_WORKSPACE/$CACHE_DIR \
42          --pr_identifier $GITHUB_REF \
43          --job_identifier $JOB_IDENTIFIER \
44          --temp_dir $RUNNER_TEMP \
45          --repo $REPO \
46          --bucket $BUCKET \
47