From eca78c30c766960c0b0dad4ec1bdd7caa4fe8ba0 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Fri, 16 Feb 2024 06:59:10 -0800 Subject: [PATCH] Add hermes commit to github action cache (#43067) Summary: The test_ios_rntester-Hermes which runs in github actions was created to make sure that recent commits on Hermes/main won't be breaking React Native However, we discovered that the job was using a cached version of hermes and it was't really downloading the latest hermes every time. With this change, the cocoapods cache will be invalidated whenever there is a commit on hermes/main, forcing the job to reinstall the dependencies when that happens. bypass-github-export-checks ## Changelog: [internal] - Fixed GH Action job to properly refetch newest version on Hermes when it changes. Pull Request resolved: https://github.com/facebook/react-native/pull/43067 Test Plan: Github Actions must be green and the action should show that a new version of Hermes is downloaded. The commit is downloaded here: {F1457505882} And it is used here, notice the last hash: {F1457505989} Reviewed By: motiz88 Differential Revision: D53853963 Pulled By: cipolleschi fbshipit-source-id: 7a65dd72a21b6da12b826273d1c92bb90b678652 --- .github/workflows/ios-tests.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ios-tests.yml b/.github/workflows/ios-tests.yml index 0a898f2979a..7677425ab0b 100644 --- a/.github/workflows/ios-tests.yml +++ b/.github/workflows/ios-tests.yml @@ -21,6 +21,13 @@ jobs: cache: 'yarn' - name: Yarn Install run: yarn install + - name: Get latest commit from Hermes + run: | + mkdir -p tmp/hermes + HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]') + echo $HERMES_TAG_SHA > tmp/hermes/hermesversion + echo "Latest Commit is:" + cat tmp/hermes/hermesversion - uses: ruby/setup-ruby@v1 with: bundler-cache: true @@ -29,7 +36,7 @@ jobs: uses: actions/cache@v3 with: path: packages/rn-tester/Pods - key: ${{ runner.os }}-RNTesterPods-${{ hashFiles('packages/rn-tester/Podfile.lock') }}-${{ hashFiles('packages/rn-tester/Podfile') }} + key: v1-${{ runner.os }}-RNTesterPods-${{ hashFiles('packages/rn-tester/Podfile.lock') }}-${{ hashFiles('packages/rn-tester/Podfile') }}-${{ hashFiles('tmp/hermes/hermesversion') }} - name: Pod Install run: | cd packages/rn-tester