Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into @BartoszGrajdek/fix-r…
Browse files Browse the repository at this point in the history
…epeated-input-history
  • Loading branch information
BartoszGrajdek committed Apr 12, 2024
2 parents 37ec0b9 + 3a409fa commit e69014b
Show file tree
Hide file tree
Showing 66 changed files with 8,912 additions and 25,892 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Test Android build
on:
pull_request:
paths:
- .github/workflows/build-android.yml
- android/**
- cpp/**
- example/package.json
- example/android/**
- react-native.config.js
merge_group:
branches:
- main
push:
branches:
- main
paths:
- .github/workflows/build-android.yml
- android/**
- cpp/**
- example/package.json
- example/android/**
- react-native.config.js

jobs:
build:
if: github.repository == 'Expensify/react-native-live-markdown'
runs-on: ubuntu-latest
concurrency:
group: build-android-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Setup Java 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Install node_modules
run: yarn install --immutable

- name: Build app
working-directory: example/android
run: ./gradlew assembleDebug --build-cache -PreactNativeArchitectures=arm64-v8a
77 changes: 77 additions & 0 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Test iOS build
on:
pull_request:
paths:
- .github/workflows/build-ios.yml
- RNLiveMarkdown.podspec
- ios/**
- cpp/**
- example/package.json
- example/ios/**
merge_group:
branches:
- main
push:
branches:
- main
paths:
- .github/workflows/build-ios.yml
- RNLiveMarkdown.podspec
- ios/**
- cpp/**
- example/package.json
- example/ios/**

jobs:
build:
if: github.repository == 'Expensify/react-native-live-markdown'
runs-on: macos-13
concurrency:
group: build-ios-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Restore node_modules from cache
uses: actions/cache@v4
with:
path: |
node_modules
example/node_modules
key: build-ios-node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: build-ios-node-modules-

- name: Install node_modules
run: yarn install --immutable

- name: Restore Pods from cache
uses: actions/cache@v4
with:
path: |
example/ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: build-ios-pods-${{ hashFiles('example/ios/Podfile.lock') }}
restore-keys: build-ios-pods-

- name: Install Pods
working-directory: example/ios
run: |
bundler install
bundler exec pod install
- name: Remove .xcode.env.local
working-directory: example/ios
run: rm -rf .xcode.env.local

- name: Restore build artifacts from cache
uses: actions/cache@v4
with:
path: ~/Library/Developer/Xcode/DerivedData
key: build-ios-derived-data-${{ hashFiles('example/ios/Podfile.lock') }}
restore-keys: build-ios-derived-data-

- name: Build app
working-directory: example
run: npx react-native@latest run-ios --no-packager
35 changes: 35 additions & 0 deletions .github/workflows/build-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test web build
on:
pull_request:
paths:
- .github/workflows/build-web.yml
- src/**
- WebExample/**
merge_group:
branches:
- main
push:
branches:
- main
paths:
- .github/workflows/build-web.yml
- src/**
- WebExample/**

jobs:
build:
if: github.repository == 'Expensify/react-native-live-markdown'
runs-on: ubuntu-latest
concurrency:
group: build-web-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install node_modules
run: yarn install --immutable

- name: Build app
working-directory: WebExample
run: npx expo export:web
56 changes: 56 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Typecheck, lint and test
on:
pull_request:
merge_group:
branches:
- main
push:
branches:
- main

jobs:
check:
if: github.repository == 'Expensify/react-native-live-markdown'
runs-on: ubuntu-latest
concurrency:
group: check-root-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install node_modules
run: yarn install --immutable

- name: Verify there's no parser diff
working-directory: parser
run: |
yarn build
if ! git diff --name-only --exit-code; then
# shellcheck disable=SC2016
echo 'Error: Parser diff detected! Please run `cd parser && yarn build` and commit the changes.'
exit 1
fi
- name: Typecheck library
run: yarn tsc --project tsconfig.json --noEmit

- name: Typecheck parser
run: yarn tsc --project parser/tsconfig.json --noEmit

- name: Typecheck example app
run: yarn tsc --project example/tsconfig.json --noEmit

- name: Typecheck WebExample app
run: yarn tsc --project WebExample/tsconfig.json --noEmit

- name: Lint
run: yarn lint

- name: Test
run: yarn test
10 changes: 3 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,14 @@ jobs:
with:
node-version: "16.x"

- name: Setup web example
run: npm ci
working-directory: ./WebExample

- run: yarn install --immutable

- name: Install node_modules
run: yarn install --immutable

- name: Verify there's no Prettier diff
run: |
yarn lint --fix --quiet
if ! git diff --name-only --exit-code; then
# shellcheck disable=SC2016
echo 'Error: Prettier diff detected! Please run `npm run prettier` and commit the changes.'
echo 'Error: Prettier diff detected! Please run `yarn lint --fix` and commit the changes.'
exit 1
fi
35 changes: 13 additions & 22 deletions RNLiveMarkdown.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,18 @@ Pod::Spec.new do |s|

s.resources = "parser/react-native-live-markdown-parser.js"

# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
if respond_to?(:install_modules_dependencies, true)
install_modules_dependencies(s)
else
s.dependency "React-Core"

# Don't install the dependencies when we run `pod install` in the old architecture.
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
s.pod_target_xcconfig = {
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
}
s.dependency "React-RCTFabric"
s.dependency "React-Codegen"
s.dependency "RCT-Folly"
s.dependency "RCTRequired"
s.dependency "RCTTypeSafety"
s.dependency "ReactCommon/turbomodule/core"
end
install_modules_dependencies(s)

if ENV['USE_FRAMEWORKS'] && ENV['RCT_NEW_ARCH_ENABLED']
add_dependency(s, "React-Fabric", :additional_framework_paths => [
"react/renderer/textlayoutmanager/platform/ios",
"react/renderer/components/textinput/iostextinput",
])
end

s.subspec "common" do |ss|
ss.source_files = "cpp/**/*.{cpp,h}"
ss.header_dir = "RNLiveMarkdown"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/cpp\"" }
end
end
Loading

0 comments on commit e69014b

Please sign in to comment.