Skip to content

Commit

Permalink
ci(action): add caching for react-native on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashwin Kumar committed Feb 27, 2025
1 parent b940a23 commit 155e5a0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 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,29 @@ 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
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} ]' \
> ${{ github.workspace }}/amplify_native_pkg_versions.json
- name: Cache All Dependencies
id: cache_paths
uses: actions/cache@v4
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 +83,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

0 comments on commit 155e5a0

Please sign in to comment.