Skip to content

Commit

Permalink
Install boto3 with retries
Browse files Browse the repository at this point in the history
  • Loading branch information
ZainRizvi committed May 4, 2023
1 parent 24573b1 commit 63226d2
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
17 changes: 16 additions & 1 deletion .github/actions/pytest-cache-download/action.yml
Expand Up @@ -6,10 +6,26 @@ inputs:
cache_dir:
description: Path to the pytest cache directory, relative to $GITHUB_WORKSPACE. This is where the merged cache will be placed.
required: true
github-token:
description: GITHUB_TOKEN
required: true

runs:
using: composite
steps:
- uses: nick-fields/retry@3e91a01664abd3c5cd539100d10d33b9c5b68482
name: Setup dependencies
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
with:
shell: bash
timeout_minutes: 5
max_attempts: 5
retry_wait_seconds: 30
command: |
set -eux
python3 -m pip install boto3==1.19.12
- name: Download the cache
shell: bash
env:
Expand All @@ -18,7 +34,6 @@ runs:
JOB: ${{ github.job }}
SHARD: ${{ inputs.shard }}
run: |
pip3 install boto3
set +x
echo "all the commands sent to the below script:""
Expand Down
17 changes: 16 additions & 1 deletion .github/actions/pytest-cache-upload/action.yml
Expand Up @@ -10,10 +10,26 @@ inputs:
description: Shard number for the current job
required: false
default: "0"
github-token:
description: GITHUB_TOKEN
required: true

runs:
using: composite
steps:
- uses: nick-fields/retry@3e91a01664abd3c5cd539100d10d33b9c5b68482
name: Setup dependencies
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
with:
shell: bash
timeout_minutes: 5
max_attempts: 5
retry_wait_seconds: 30
command: |
set -eux
python3 -m pip install boto3==1.19.12
- name: Upload the cache
shell: bash
env:
Expand All @@ -22,7 +38,6 @@ runs:
JOB: ${{ github.job }}
SHARD: ${{ inputs.shard }}
run: |
pip3 install boto3
set +x
echo "all the commands sent to the below script:""
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/_linux-build.yml
Expand Up @@ -85,6 +85,7 @@ jobs:
- name: Upload pytest cache
uses: ./.github/actions/pytest-cache-upload
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
cache_dir: .pytest_cache
# shard: ${{ matrix.shard }}

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/_linux-test.yml
Expand Up @@ -110,6 +110,7 @@ jobs:
# - name: Download pytest cache
# uses: ./.github/actions/pytest-cache-download
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# cache_dir: ${GITHUB_WORKSPACE}/.pytest_cache

- name: Set Test step time
Expand Down Expand Up @@ -224,6 +225,7 @@ jobs:
# continue-on-error: true
if: always() && steps.test.conclusion && steps.test.conclusion != 'skipped'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
cache_dir: .pytest_cache
shard: ${{ matrix.shard }}

Expand Down

0 comments on commit 63226d2

Please sign in to comment.