1name: Upload PyTest cache 2 3description: Uploads the pytest cache to S3 4 5inputs: 6 cache_dir: 7 description: Path to the pytest cache directory, relative to $GITHUB_WORKSPACE. This folder will be zipped and uploaded to S3. 8 required: true 9 shard: 10 description: Shard number for the current job 11 required: false 12 default: "0" 13 sha: 14 description: SHA for the commit 15 required: true 16 test_config: 17 description: Name of the test config 18 required: false 19 default: "default" 20 job_identifier: 21 description: Text that uniquely identifies a given job type within a workflow. All shards of a job should share the same job identifier. 22 required: true 23 24runs: 25 using: composite 26 steps: 27 - uses: nick-fields/retry@v3.0.0 28 name: Setup dependencies 29 with: 30 shell: bash 31 timeout_minutes: 5 32 max_attempts: 5 33 retry_wait_seconds: 30 34 command: | 35 set -eu 36 python3 -m pip install boto3==1.19.12 37 38 - name: Upload the cache 39 shell: bash 40 env: 41 CACHE_DIR: ${{ inputs.cache_dir }} 42 JOB_IDENTIFIER: ${{ inputs.job_identifier }} 43 SHA: ${{ inputs.sha }} 44 TEST_CONFIG: ${{ inputs.test_config }} 45 SHARD: ${{ inputs.shard }} 46 REPO: ${{ github.repository }} 47 run: | 48 python3 .github/scripts/pytest_cache.py \ 49 --upload \ 50 --cache_dir $GITHUB_WORKSPACE/$CACHE_DIR \ 51 --pr_identifier $GITHUB_REF \ 52 --job_identifier $JOB_IDENTIFIER \ 53 --sha $SHA \ 54 --test_config $TEST_CONFIG \ 55 --shard $SHARD \ 56 --repo $REPO \ 57 --temp_dir $RUNNER_TEMP \ 58