Skip to content

Commit de1967d

Browse files
robandpdxfacebook-github-bot
authored andcommitted
convert circleci to github actions part 3 (facebook#44511)
Summary: One of the last parts of the migration. This PR foucuses on bringing the template jobs to Github actions. bypass-github-export-checks ## Changelog: [Internal] - Migrate template jobs from CCI to GH Pull Request resolved: facebook#44511 Test Plan: https://fburl.com/workplace/f6mz6tmw Reviewed By: blakef Differential Revision: D57202477 Pulled By: cipolleschi fbshipit-source-id: be562cd3690d221f094dc734dd501aac25c36f59
1 parent 1ad69d9 commit de1967d

File tree

6 files changed

+552
-3
lines changed

6 files changed

+552
-3
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: prepare_ios_tests
2+
description: Prepare iOS Tests
3+
runs:
4+
using: composite
5+
steps:
6+
- name: brew install xcbeautify
7+
run: brew install xcbeautify
8+
shell: bash
9+
- name: Run Ruby Tests
10+
shell: bash
11+
run: |
12+
cd packages/react-native/scripts
13+
sh run_ruby_tests.sh
14+
- name: Boot iPhone Simulator
15+
shell: bash
16+
run: source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true
17+
- name: "Brew: Tap wix/brew"
18+
shell: bash
19+
run: brew tap wix/brew
20+
- name: brew install applesimutils watchman
21+
shell: bash
22+
run: brew install applesimutils watchman
23+
- name: Configure Watchman
24+
shell: bash
25+
run: echo "{}" > .watchmanconfig
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: report_bundle_size
2+
description: Report bundle size
3+
inputs:
4+
platform:
5+
description: Platform. Either ios or android
6+
default: ios
7+
runs:
8+
using: composite
9+
steps:
10+
- name: Report size of RNTester.app (analysis-bot)
11+
shell: bash
12+
run: GITHUB_TOKEN=${{ secrets.PUBLIC_ANALYSISBOT_GITHUB_TOKEN }} scripts/circleci/report-bundle-size.sh ${{ inputs.platform }} || true

.github/actions/run_e2e/action.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: run_e2e
2+
description: "Run End-to-End Tests"
3+
inputs:
4+
platform:
5+
description: "Platform to run tests on"
6+
required: true
7+
default: "js"
8+
retries:
9+
description: "Number of times to retry failed tests"
10+
required: true
11+
default: "3"
12+
runs:
13+
using: composite
14+
steps:
15+
- name: "Run Tests: ${{ inputs.platform }} End-to-End Tests"
16+
run: node ./scripts/e2e/run-ci-e2e-tests.js --${{ inputs.platform }} --retries ${{ inputs.retries }}
17+
shell: bash
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: test_ios_template
2+
description: Test iOS Template
3+
inputs:
4+
jsengine:
5+
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
6+
default: Hermes
7+
use-frameworks:
8+
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
9+
default: StaticLibraries
10+
architecture:
11+
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup
12+
default: OldArch
13+
ruby-version:
14+
description: The version of ruby that must be used
15+
default: 2.6.10
16+
flavor:
17+
description: The flavor of the build. Must be one of "Debug", "Release".
18+
default: Debug
19+
hermes-version:
20+
description: The version of hermes
21+
required: true
22+
react-native-version:
23+
description: The version of react-native
24+
required: true
25+
runs:
26+
using: composite
27+
steps:
28+
- name: Setup xcode
29+
uses: ./.github/actions/setup-xcode
30+
- name: Setup node.js
31+
uses: ./.github/actions/setup-node
32+
- name: Run yarn
33+
shell: bash
34+
run: yarn install --non-interactive
35+
- name: Cache setup
36+
id: cache_setup
37+
uses: ./.github/actions/cache_setup
38+
with:
39+
hermes-version: ${{ inputs.hermes-version }}
40+
react-native-version: ${{ inputs.react-native-version }}
41+
- name: Download npm package artifact
42+
uses: actions/[email protected]
43+
with:
44+
name: react-native-package
45+
path: build
46+
- name: Setup Hermes workspace
47+
uses: ./.github/actions/setup_hermes_workspace
48+
- name: Setup ruby
49+
uses: ruby/[email protected]
50+
with:
51+
ruby-version: ${{ inputs.ruby-version }}
52+
- name: Set HERMES_ENGINE_TARBALL_PATH
53+
if: inputs.jsengine == 'Hermes'
54+
shell: bash
55+
run: |
56+
BUILD_TYPE="${{ inputs.flavor }}"
57+
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
58+
echo "export HERMES_ENGINE_TARBALL_PATH=$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME" >> $GITHUB_ENV
59+
- name: Create iOS template project
60+
shell: bash
61+
run: |
62+
PACKAGE=$(cat build/react-native-package-version)
63+
PATH_TO_PACKAGE="$GITHUB_WORKSPACE/build/$PACKAGE"
64+
node ./scripts/releases/update-template-package.js "{\"react-native\":\"file:$PATH_TO_PACKAGE\"}"
65+
node ./scripts/e2e/init-template-e2e.js --projectName $PROJECT_NAME --templatePath "$GITHUB_WORKSPACE/packages/react-native" --directory "/tmp/$PROJECT_NAME" --verbose
66+
- name: Yarn install in template project
67+
shell: bash
68+
run: |
69+
cd /tmp/$PROJECT_NAME/android/
70+
yarn install --non-interactive
71+
- name: Install iOS dependencies - Configuration ${{ inputs.flavor }}; New Architecture ${{ inputs.architecture }}; JS Engine ${{ inputs.jsengine }}
72+
shell: bash
73+
run: |
74+
cd /tmp/$PROJECT_NAME/ios
75+
76+
if [[ ${{ inputs.architecture }} == "NewArch" ]]; then
77+
export RCT_NEW_ARCH_ENABLED=1
78+
fi
79+
80+
if [[ ${{ inputs.jsengine }} == "JSC" ]]; then
81+
export USE_HERMES=0
82+
fi
83+
84+
if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then
85+
export USE_FRAMEWORKS=dynamic
86+
fi
87+
88+
cd ..
89+
bundle install
90+
bundle exec pod install --project-directory=ios
91+
- name: Build template project
92+
shell: bash
93+
run: |
94+
xcodebuild build \
95+
-configuration ${{ inputs.flavor }} \
96+
-workspace /tmp/$PROJECT_NAME/ios/$PROJECT_NAME.xcworkspace \
97+
-scheme $PROJECT_NAME \
98+
-sdk iphonesimulator

.github/workflows/ios-tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ jobs:
1414
steps:
1515
- name: Checkout Repo
1616
uses: actions/checkout@v4
17-
- name: Setup Node
18-
uses: actions/setup-node@v4
17+
- name: Setup node.js
18+
uses: ./.github/actions/setup-node
1919
with:
2020
node-version: 20
21-
cache: 'yarn'
2221
- name: Yarn Install
2322
run: yarn install
2423
- name: Get latest commit from Hermes

0 commit comments

Comments
 (0)