Skip to content

Commit

Permalink
[LOCAL][CI] Fix Helloworld ios jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
cipolleschi committed Jun 26, 2024
1 parent 52db082 commit 49d395b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
16 changes: 14 additions & 2 deletions .github/actions/test_ios_helloworld/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ runs:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Create Hermes folder
shell: bash
run: mkdir -p "$HERMES_WS_DIR"
- name: Download Hermes
uses: actions/download-artifact@v4
with:
name: hermes-darwin-bin-${{ inputs.flavor }}
path: $HERMES_WS_DIR/hermes-runtime-darwin/
path: /tmp/hermes/hermes-runtime-darwin/
- name: Print Downloaded hermes
shell: bash
run: ls -lR "$HERMES_WS_DIR"
Expand Down Expand Up @@ -80,16 +81,27 @@ runs:
args+=(--jsvm jsc)
yarn bootstrap ios "${args[@]}" | cat
else
# Tarball is restored with capital flavors suffix, but somehow the tarball name from JS at line 96 returns as lowercased.
# Let's ensure that the tarballs have the right names
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz"
fi
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz"
fi
BUILD_TYPE="${{ inputs.flavor }}"
TARBALL_FILENAME=$(node ../react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
HERMES_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/hermes-darwin-bin-${{ inputs.flavor }}/$TARBALL_FILENAME"
HERMES_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
HERMES_ENGINE_TARBALL_PATH="$HERMES_PATH" yarn bootstrap ios "${args[@]}" | cat
fi
- name: Build HelloWorld project
shell: bash
run: |
cd packages/helloworld
args=()
if [[ ${{ inputs.flavor }} == "Release" ]]; then
args+=(--prod)
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ jobs:
echo "[HERMES] Creating the universal framework"
chmod +x ./utils/build-ios-framework.sh
./utils/build-ios-framework.sh build_framework
chmod +x ./destroot/bin/hermesc
- name: Package the Hermes Apple frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
Expand All @@ -310,7 +312,7 @@ jobs:
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
ls -lR /tmp/hermes/osx-bin/
- name: Create dSYM archive
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
FLAVOR=${{ matrix.flavor }}
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ jobs:
echo "[HERMES] Creating the universal framework"
chmod +x ./utils/build-ios-framework.sh
./utils/build-ios-framework.sh build_framework
chmod +x ./destroot/bin/hermesc
- name: Package the Hermes Apple frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
Expand All @@ -307,7 +309,7 @@ jobs:
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
ls -lR /tmp/hermes/osx-bin/
- name: Create dSYM archive
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
FLAVOR=${{ matrix.flavor }}
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
- name: Restore Cached Artifacts
uses: actions/cache/[email protected]
with:
key: v2-hermes-osx-bin-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
/tmp/hermes/osx-bin/${{ matrix.flavor }}
/tmp/hermes/dSYM/${{ matrix.flavor }}
Expand Down Expand Up @@ -292,6 +292,8 @@ jobs:
echo "[HERMES] Creating the universal framework"
chmod +x ./utils/build-ios-framework.sh
./utils/build-ios-framework.sh build_framework
chmod +x ./destroot/bin/hermesc
- name: Package the Hermes Apple frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
Expand All @@ -318,7 +320,7 @@ jobs:
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ matrix.flavor }}
ls -lR /tmp/hermes/osx-bin/
- name: Create dSYM archive
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != true }}
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
FLAVOR=${{ matrix.flavor }}
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
Expand Down Expand Up @@ -364,7 +366,7 @@ jobs:
uses: actions/cache/[email protected]
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
with:
key: v2-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
path: |
/tmp/hermes/osx-bin/${{ matrix.flavor }}
/tmp/hermes/dSYM/${{ matrix.flavor }}
Expand Down
6 changes: 3 additions & 3 deletions scripts/e2e/init-template-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

const {retry} = require('../circleci/retry');
const {REPO_ROOT} = require('../consts');
const {getPackages} = require('../utils/monorepo');
const {getPackages, ProjectInfo} = require('../utils/monorepo');
const {
VERDACCIO_SERVER_URL,
VERDACCIO_STORAGE_PATH,
Expand Down Expand Up @@ -172,7 +172,7 @@ async function installProjectUsingProxy(cwd /*: string */) {
}
}

function _updateScopedPackages(packages, directory) {
function _updateScopedPackages(packages /*: ProjectInfo */, directory /*: string */) {
console.log('Updating the scoped packagesto match the version published in Verdaccio');

// Packages are updated in a lockstep and all with the same version.
Expand Down Expand Up @@ -207,7 +207,7 @@ function _updateScopedPackages(packages, directory) {
console.log('Done ✅');
}

function _updateReactNativeInTemplateIfNeeded(pathToLocalReactNative, directory) {
function _updateReactNativeInTemplateIfNeeded(pathToLocalReactNative /*: string */, directory /*: string */) {
if (pathToLocalReactNative != null) {
console.log('Updating the template version to local react-native');
// Update template version.
Expand Down

0 comments on commit 49d395b

Please sign in to comment.