Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/actions/download-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Download artifact with retries
description: Downloads an artifact, retrying transient failures up to two times

inputs:
name:
description: Artifact name
required: true
path:
description: Destination path
required: true

outputs:
download-path:
description: Absolute path where the artifact was downloaded
value: ${{ steps.download-3.outputs.download-path || steps.download-2.outputs.download-path || steps.download-1.outputs.download-path }}

runs:
using: composite
steps:
- name: Download artifact (attempt 1 of 3)
id: download-1
if: ${{ always() }}
continue-on-error: true
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}

- name: Wait before attempt 2
if: ${{ always() && steps.download-1.outcome == 'failure' }}
shell: bash
run: |
echo "::warning::Artifact download failed; retrying in 10 seconds"
sleep 10

- name: Download artifact (attempt 2 of 3)
id: download-2
if: ${{ always() && steps.download-1.outcome == 'failure' }}
continue-on-error: true
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}

- name: Wait before attempt 3
if: ${{ always() && steps.download-2.outcome == 'failure' }}
shell: bash
run: |
echo "::warning::Artifact download failed again; retrying in 20 seconds"
sleep 20

- name: Download artifact (attempt 3 of 3)
id: download-3
if: ${{ always() && steps.download-2.outcome == 'failure' }}
# Deliberately do not continue on error: the last failure must fail the caller.
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
10 changes: 5 additions & 5 deletions .github/workflows/e2e-ios-templateapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ jobs:
with:
ruby-version: 2.6.10
- name: Download React Native Package
uses: actions/download-artifact@v7
uses: ./.github/actions/download-artifact
with:
name: react-native-package
path: /tmp/react-native-tmp
- name: Print /tmp folder
run: ls -lR /tmp/react-native-tmp
- name: Download ReactNativeDependencies
uses: actions/download-artifact@v7
uses: ./.github/actions/download-artifact
with:
name: ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
path: /tmp/third-party
- name: Print third-party folder
shell: bash
run: ls -lR /tmp/third-party
- name: Download React Native Prebuilds
uses: actions/download-artifact@v7
uses: ./.github/actions/download-artifact
with:
name: ReactCore${{ matrix.flavor }}.xcframework.tar.gz
path: /tmp/ReactCore
Expand Down Expand Up @@ -114,15 +114,15 @@ jobs:
- name: Run yarn
uses: ./.github/actions/yarn-install
- name: Download app
uses: actions/download-artifact@v7
uses: ./.github/actions/download-artifact
with:
name: RNTestProject-${{ matrix.flavor }}
path: /tmp/RNTestProjectBuild/RNTestProject.app
- name: Check downloaded folder content
run: ls -l /tmp/RNTestProjectBuild/RNTestProject.app
- name: Download React Native Package
if: ${{ matrix.flavor == 'Debug' }}
uses: actions/download-artifact@v7
uses: ./.github/actions/download-artifact
with:
name: react-native-package
path: /tmp/react-native-tmp
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-ios-spm-newapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,27 @@ jobs:
# release/ artifact slots together (and `--download skip` refuses an
# incomplete slot). Please don't "optimise" this down to one flavor.
- name: Download ReactCore (Debug)
uses: actions/download-artifact@v7
uses: ./.github/actions/download-artifact
with:
name: ReactCoreDebug.xcframework.tar.gz
path: /tmp/rc-debug
- name: Download ReactCore (Release)
uses: actions/download-artifact@v7
uses: ./.github/actions/download-artifact
with:
name: ReactCoreRelease.xcframework.tar.gz
path: /tmp/rc-release
- name: Download ReactNativeDependencies (Debug)
uses: actions/download-artifact@v7
uses: ./.github/actions/download-artifact
with:
name: ReactNativeDependenciesDebug.xcframework.tar.gz
path: /tmp/deps-debug
- name: Download ReactNativeDependencies (Release)
uses: actions/download-artifact@v7
uses: ./.github/actions/download-artifact
with:
name: ReactNativeDependenciesRelease.xcframework.tar.gz
path: /tmp/deps-release
- name: Download React Native package
uses: actions/download-artifact@v7
uses: ./.github/actions/download-artifact
with:
name: react-native-package
path: /tmp/react-native-tmp
Expand Down
Loading