-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathaction.yml
More file actions
56 lines (52 loc) · 1.92 KB
/
action.yml
File metadata and controls
56 lines (52 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Setup Amplify Integration Test Package
description: Checks out "amplify-js-samples-staging" and builds the package with caching
inputs:
GH_TOKEN_STAGING_READ:
description: The token that grants read access to the sample staging repo
required: true
runs:
using: 'composite'
steps:
- name: Create cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
id: cache-samples-staging-build
with:
key: aws-amplify-js-samples-staging-build-${{ github.sha }}
path: |
./amplify-js-samples-staging/node_modules
/home/runner/.cache/Cypress
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
- name: Checkout staging repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: ${{ github.repository_owner }}/amplify-js-samples-staging
path: amplify-js-samples-staging
token: ${{ inputs.GH_TOKEN_STAGING_READ }}
# We test on the staging branch that corresponds to the amplify-js branch
# when it exists and test on the default branch `main` otherwise
- name: Staging repo branch selection
shell: bash
working-directory: ./amplify-js-samples-staging
env:
BRANCH: ${{ github.ref_name }}
run: |
if git ls-remote --exit-code --heads origin refs/heads/$BRANCH; then
# Corresponding branch on sample repo exists, check it out
git fetch origin $BRANCH
git checkout $BRANCH
echo "Checked out branch: $BRANCH"
else
# Corresponding branch doesn't exist, default to main
echo "Branch '$BRANCH' does not exist"
fi
- name: Install
shell: bash
working-directory: ./amplify-js-samples-staging
run: |
for i in {1..3}; do
echo "Starting attempt $i."
yarn && break
echo "Attempt $i failed."
sleep 5
done