Skip to content

Commit

Permalink
Merge commit '12b64b78247f2db929c6d421262bdec1f6402e0b' into android
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongwuzw committed Jul 9, 2024
2 parents fc682e8 + 12b64b7 commit c6d13d9
Show file tree
Hide file tree
Showing 260 changed files with 5,835 additions and 2,507 deletions.
6 changes: 2 additions & 4 deletions .circleci/configurations/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ jobs:
when: always

- run:
name: Sanity checks
command: |
./scripts/circleci/check_license.sh
./scripts/circleci/validate_yarn_lockfile.sh
name: Check license
command: ./scripts/circleci/check_license.sh
when: always

- run:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/configurations/test_workflows/testAll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
parameters:
jsengine: ["Hermes", "JSC"]
- test_ios_rntester:
run_unit_tests: true
run_unit_tests: false
use_frameworks: "StaticLibraries"
ruby_version: "2.6.10"
requires:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/configurations/test_workflows/testIOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
parameters:
jsengine: ["Hermes", "JSC"]
- test_ios_rntester:
run_unit_tests: true
run_unit_tests: false
use_frameworks: "StaticLibraries"
ruby_version: "2.6.10"
requires:
Expand Down
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ untyped-import
untyped-type-import

[version]
^0.238.0
^0.239.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: cache_setup
name: cache-setup
description: "Cache setup"
inputs:
hermes-version:
Expand Down
16 changes: 8 additions & 8 deletions .github/actions/create-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: create_release
description: Creates a new React Native release
inputs:
version:
description: 'The version of React Native we want to release. For example 0.75.0-rc.0'
description: "The version of React Native we want to release. For example 0.75.0-rc.0"
required: true
is_latest_on_npm:
description: 'Whether we want to tag this release as latest on NPM'
is-latest-on-npm:
description: "Whether we want to tag this release as latest on NPM"
required: true
default: "false"
dry_run:
description: 'Whether the job should be executed in dry-run mode or not'
dry-run:
description: "Whether the job should be executed in dry-run mode or not"
default: "true"
runs:
using: composite
Expand All @@ -27,8 +27,8 @@ runs:
run: |
node scripts/releases/create-release-commit.js \
--reactNativeVersion "${{ inputs.version }}" \
--tagAsLatestRelease "${{ inputs.is_latest_on_npm }}" \
--dryRun "${{ inputs.dry_run }}"
--tagAsLatestRelease "${{ inputs.is-latest-on-npm }}" \
--dryRun "${{ inputs.dry-run }}"
GIT_PAGER=cat git show HEAD
- name: Update "latest" tag if needed
shell: bash
Expand All @@ -39,7 +39,7 @@ runs:
git tag -a "latest" -m "latest"
- name: Pushing release commit
shell: bash
if: ${{ inputs.dry_run == 'false' }}
if: ${{ inputs.dry-run == 'false' }}
run: |
CURR_BRANCH="$(git branch --show-current)"
git push origin "$CURR_BRANCH" --follow-tags
43 changes: 43 additions & 0 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: lint
description: Runs all the linters in the codebase
inputs:
node-version:
description: "The node.js version to use"
required: false
default: "18"
github-token:
description: "The GitHub token used by pull-bot"
required: true
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
with:
node-version: ${{ inputs.node-version }}
- name: Yarn install
shell: bash
run: yarn install --non-interactive --frozen-lockfile
- name: Run linters against modified files (analysis-bot)
shell: bash
run: yarn lint-ci
env:
GITHUB_TOKEN: ${{ inputs.github-token}}
- name: Lint code
shell: bash
run: ./scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ./reports/junit/eslint/results.xml
- name: Lint java
shell: bash
run: ./scripts/circleci/exec_swallow_error.sh yarn lint-java --check
- name: Run flowcheck
shell: bash
run: yarn flow-check
- name: Run typescript check
shell: bash
run: yarn test-typescript
- name: Check license
shell: bash
run: ./scripts/circleci/check_license.sh
- name: Check formatting
shell: bash
run: yarn run format-check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: prepare_ios_tests
name: prepare-ios-tests
description: Prepare iOS Tests
runs:
using: composite
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: report_bundle_size
name: report-bundle-size
description: Report bundle size
inputs:
platform:
Expand Down
19 changes: 0 additions & 19 deletions .github/actions/run_e2e/action.yml

This file was deleted.

12 changes: 8 additions & 4 deletions .github/actions/setup-gradle/action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
name: Setup gradle
description: "Set up your GitHub Actions workflow with a specific version of gradle"
inputs:
cache-allow-write:
description: "Wether the Gradle Cache should be allowed to be written by this job or not"
default: "false"
cache-read-only:
description: "Whether the Gradle Cache should be in read-only mode so this job won't be allowed to write to it"
default: "true"
runs:
using: "composite"
steps:
- name: Setup gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
cache-read-only: ${{ inputs.cache-allow-write == 'false' }}
# We want the Gradle cache to be written only on main/-stable branches run, and only for jobs with `cache-read-only` == false (i.e. `build_android`).
cache-read-only: ${{ (github.ref != 'refs/heads/main' && !contains(github.ref, '-stable')) || inputs.cache-read-only == 'true' }}
# Similarly, for those jobs we want to start with a clean cache so it doesn't grow without limits (this is the negation of the previous condition).
cache-write-only: ${{ (github.ref == 'refs/heads/main' || contains(github.ref, '-stable')) && inputs.cache-read-only != 'true' }}
gradle-home-cache-cleanup: true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: setup_xcode_build_cache
name: setup-xcode-build-cache
description: Add caching to iOS jobs to speed up builds
inputs:
hermes-version:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,21 @@
name: test_ios_helloworld
name: test-ios-helloworld
description: Test iOS Hello World
inputs:
jsengine:
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
type: choice
default: Hermes
options:
- JSC
- Hermes
use-frameworks:
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
type: choice
default: StaticLibraries
options:
- StaticLibraries
- DynamicFrameworks
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
default: StaticLibraries
architecture:
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup
type: choice
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup. Must be one of "OldArch" or "NewArch"
default: OldArch
options:
- OldArch
- NewArch
ruby-version:
description: The version of ruby that must be used
default: 2.6.10
flavor:
description: The flavor of the build. Must be one of "Debug", "Release".
type: choice
default: Debug
options:
- Debug
- Release
hermes-version:
description: The version of hermes
required: true
Expand All @@ -45,17 +29,20 @@ runs:
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
- name: Create Hermes folder
shell: bash
run: mkdir -p "$HERMES_WS_DIR"
- name: Download Hermes
uses: actions/download-artifact@v4
with:
hermes-version: ${{ inputs.hermes-version }}
react-native-version: ${{ inputs.react-native-version }}
name: hermes-darwin-bin-${{ inputs.flavor }}
path: /tmp/hermes/hermes-runtime-darwin/
- name: Print Downloaded hermes
shell: bash
run: ls -lR "$HERMES_WS_DIR"
- name: Run yarn
shell: bash
run: yarn install --non-interactive
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Setup ruby
uses: ruby/[email protected]
with:
Expand All @@ -78,6 +65,17 @@ 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/$TARBALL_FILENAME"
Expand All @@ -87,6 +85,7 @@ runs:
shell: bash
run: |
cd packages/helloworld
args=()
if [[ ${{ inputs.flavor }} == "Release" ]]; then
args+=(--prod)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: test_ios_rntester
name: test-ios-rntester
description: Test iOS RNTester
inputs:
jsengine:
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
default: Hermes
use-frameworks:
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
default: StaticLibraries
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
default: StaticLibraries
architecture:
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup
default: NewArch
Expand All @@ -15,7 +15,7 @@ inputs:
default: 2.6.10
run-unit-tests:
description: whether unit tests should run or not.
default: false
default: "false"
hermes-tarball-artifacts-dir:
description: The directory where the hermes tarball artifacts are stored
default: /tmp/hermes/hermes-runtime-darwin
Expand All @@ -38,19 +38,18 @@ runs:
- name: Run yarn
shell: bash
run: yarn install --non-interactive
- name: Cache setup
id: cache_setup
uses: ./.github/actions/cache_setup
- name: Download Hermes
uses: actions/download-artifact@v4
with:
hermes-version: ${{ inputs.hermes-version }}
react-native-version: ${{ inputs.react-native-version }}
name: hermes-darwin-bin-${{ inputs.flavor }}
path: ${{ inputs.hermes-tarball-artifacts-dir }}
- name: Setup ruby
uses: ruby/[email protected]
with:
ruby-version: ${{ inputs.ruby-version }}
- name: Prepare IOS Tests
if: ${{ inputs.run-unit-tests == true }}
uses: ./.github/actions/prepare_ios_tests
if: ${{ inputs.run-unit-tests == 'true' }}
uses: ./.github/actions/prepare-ios-tests
- name: Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
shell: bash
run: |
Expand Down Expand Up @@ -82,14 +81,15 @@ runs:
if [[ -e $TARBALL_PATH ]]; then
tar -xf $TARBALL_PATH
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
chmod +x ./destroot/bin/hermes
./destroot/bin/hermes test.js
rm test.js
rm -rf destroot
else
echo 'No Hermes tarball found.'
fi
- name: Setup xcode build cache
uses: ./.github/actions/setup_xcode_build_cache
uses: ./.github/actions/setup-xcode-build-cache
with:
hermes-version: ${{ inputs.hermes-version }}
- name: Install CocoaPods dependencies
Expand All @@ -114,19 +114,19 @@ runs:
bundle install
bundle exec pod install
- name: Build RNTester
if: ${{ inputs.run-unit-tests != true }}
if: ${{ inputs.run-unit-tests != 'true' }}
shell: bash
run: |
xcodebuild build \
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
-scheme RNTester \
-sdk iphonesimulator
- name: "Run Tests: iOS Unit and Integration Tests"
if: ${{ inputs.run-unit-tests == true }}
if: ${{ inputs.run-unit-tests == 'true' }}
shell: bash
run: yarn test-ios
- name: Zip Derived data folder
if: ${{ inputs.run-unit-tests == true }}
if: ${{ inputs.run-unit-tests == 'true' }}
shell: bash
run: |
echo "zipping tests results"
Expand All @@ -135,17 +135,17 @@ runs:
tar -zcvf xcresults.tar.gz $XCRESULT_PATH
- name: Upload artifact
uses: actions/[email protected]
if: ${{ inputs.run-unit-tests == true }}
if: ${{ inputs.run-unit-tests == 'true' }}
with:
name: xcresults
path: /Users/distiller/Library/Developer/Xcode/xcresults.tar.gz
- name: Report bundle size
if: ${{ inputs.run-unit-tests == true }}
uses: ./.github/actions/report_bundle_size
if: ${{ inputs.run-unit-tests == 'true' }}
uses: ./.github/actions/report-bundle-size
with:
platform: ios
- name: Store test results
if: ${{ inputs.run-unit-tests == true }}
if: ${{ inputs.run-unit-tests == 'true' }}
uses: actions/[email protected]
with:
name: test-results
Expand Down
Loading

0 comments on commit c6d13d9

Please sign in to comment.