Skip to content

ci(action): add caching for react-native on ci #14232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
21 changes: 20 additions & 1 deletion .github/workflows/callable-e2e-test-detox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,31 @@ jobs:
GH_TOKEN_STAGING_READ: ${{ secrets.GH_TOKEN_STAGING_READ }}
- name: Load Verdaccio with AmplifyJs
uses: ./amplify-js/.github/actions/load-verdaccio-with-amplify-js
- name: Get AmplifyJS native modules package bump
env:
GH_WORKSPACE: ${{ github.workspace }}
working-directory: ./amplify-js/
run: |
npx lerna version --conventional-commits --no-git-tag-version --no-push --json --yes | \
jq -c '[ .[] | select(.name | IN("@aws-amplify/react-native", "@aws-amplify/rtn-push-notification", "@aws-amplify/rtn-web-browser")) | {name, newVersion} ]' \
> $GH_WORKSPACE/amplify_native_pkg_versions.json
- name: Cache All Dependencies
id: cache_paths
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: |
${{ inputs.working_directory }}/ios/Pods
${{ inputs.working_directory }}/ios/build
key: ${{ inputs.test_name }}-detox-cache-${{ hashFiles(format('{0}/yarn.lock', inputs.working_directory), format('{0}/ios/Podfile.lock', inputs.working_directory), format('{0}/amplify_native_pkg_versions.json', github.workspace)) }}
- name: Yarn Install
working-directory: ${{ inputs.working_directory }}
run: |
rm -rf yarn.lock
echo "Current NPM registry: " $(yarn config get registry)
$GITHUB_WORKSPACE/amplify-js/scripts/retry-yarn-script.sh -s 'install --frozen-lockfile --non-interactive' -n 3
$GITHUB_WORKSPACE/amplify-js/scripts/retry-yarn-script.sh -s 'install --non-interactive' -n 3
shell: bash
- name: Install CocoaPods
if: steps.cache_paths.outputs.cache-hit != 'true'
run: |
cd ios && pod install
working-directory: ${{ inputs.working_directory }}
Expand All @@ -67,6 +85,7 @@ jobs:
working-directory: ${{ inputs.working_directory }}
shell: bash
- name: Detox Build
if: steps.cache_paths.outputs.cache-hit != 'true'
run: |
detox build -c ios.sim.debug
env:
Expand Down
Loading