Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Actions for library and example apps #134

Merged
merged 63 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d07a946
align lint command names with respective directories
robertKozik Jan 18, 2024
d6e7795
create static check github action for subdirectories
robertKozik Jan 18, 2024
678d4b8
create static check github action for src
robertKozik Jan 18, 2024
44d6398
fix typo
robertKozik Jan 18, 2024
4c7595e
create android build github action
robertKozik Jan 19, 2024
5e8566c
create ios build github action
robertKozik Jan 19, 2024
f43ce0e
uncomment push restrinctions for github actions
robertKozik Jan 19, 2024
fcb4cd6
add missing new line on EOF
robertKozik Jan 19, 2024
ca6614f
fix typo on example directory
robertKozik Jan 19, 2024
64235d2
Merge branch 'main' into CI-improve
tomekzaw Feb 23, 2024
6900258
Update package.json
tomekzaw Feb 23, 2024
9c40932
Update build-android.yml
tomekzaw Feb 23, 2024
6c88d02
Update build-ios.yml
tomekzaw Feb 23, 2024
cfa7b21
update minimum deployemnt version to 12.4 for iOS
robertKozik Feb 23, 2024
960acdc
specify build device
robertKozik Feb 26, 2024
6ca447f
go back to macos-12
robertKozik Feb 26, 2024
d4a4554
Revert "go back to macos-12"
robertKozik Feb 26, 2024
cefb045
update podfile.lock
robertKozik Feb 26, 2024
1ee1b3a
Merge branch 'main' into CI-improve
robertKozik Feb 26, 2024
96b2078
replace build command for ios
robertKozik Feb 26, 2024
e6bc6b2
Merge branch 'main' into CI-improve
tomekzaw Apr 9, 2024
f430188
Improve root check
tomekzaw Apr 9, 2024
6b776d0
Improve root check
tomekzaw Apr 9, 2024
27c3228
Add web build
tomekzaw Apr 9, 2024
9d6d790
Merge branch 'main' into CI-improve
tomekzaw Apr 9, 2024
6efdffb
Improve static checks
tomekzaw Apr 9, 2024
c696931
Fix iOS build
tomekzaw Apr 9, 2024
c41fb1e
Remove `build:android` and `build:ios` commands
tomekzaw Apr 9, 2024
4a021a3
Install missing dependencies and split typecheck into separate steps
tomekzaw Apr 9, 2024
1aec459
Verify there's no parser diff
tomekzaw Apr 9, 2024
ced26da
Unify step names
tomekzaw Apr 9, 2024
f0ee77b
Remove matrix strategy
tomekzaw Apr 9, 2024
7b4dbf5
Last chance
tomekzaw Apr 9, 2024
664e16a
Add latest
tomekzaw Apr 9, 2024
2b26caa
Commit
tomekzaw Apr 9, 2024
6e9c946
Commit
tomekzaw Apr 9, 2024
20d0c2c
Bump React Native version
tomekzaw Apr 9, 2024
04af491
Add simulator
tomekzaw Apr 9, 2024
a036e8e
Update build-ios.yml
tomekzaw Apr 9, 2024
7cdce03
Setup Node
tomekzaw Apr 9, 2024
d98a42a
Changes
tomekzaw Apr 10, 2024
f7d3843
Some more changes
tomekzaw Apr 10, 2024
7964eb1
final solution
tomekzaw Apr 10, 2024
96a72ba
final v2
tomekzaw Apr 10, 2024
279664e
remove one line
tomekzaw Apr 10, 2024
4ba2e11
update stuff
tomekzaw Apr 10, 2024
63aa08d
one more try
tomekzaw Apr 10, 2024
f169ca6
again
tomekzaw Apr 10, 2024
7640288
next commit
tomekzaw Apr 10, 2024
2c88622
update
tomekzaw Apr 10, 2024
1519b1b
update2
tomekzaw Apr 10, 2024
f8e658d
update keys
tomekzaw Apr 10, 2024
3893ba8
Merge branch 'main' into CI-improve
tomekzaw Apr 10, 2024
5385ba0
Update Podfile.lock
tomekzaw Apr 10, 2024
225ebf6
Add restore keys
tomekzaw Apr 10, 2024
aa0d9de
Restore original platform
tomekzaw Apr 10, 2024
8e5fd9e
Add `reactNativeArchitectures`
tomekzaw Apr 11, 2024
c4daf80
Restore original React Native version
tomekzaw Apr 11, 2024
f2a4ba6
Merge branch 'main' into CI-improve
tomekzaw Apr 11, 2024
71578a0
Restore original formatting
tomekzaw Apr 11, 2024
bfb24e5
Merge branch 'main' into CI-improve
tomekzaw Apr 11, 2024
9726597
Update Podfile.lock
tomekzaw Apr 11, 2024
17fc391
Add more paths
tomekzaw Apr 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test Android build
on:
pull_request:
paths:
- .github/workflows/build-android.yml
- android/**
- example/package.json
- example/android/**
tomekzaw marked this conversation as resolved.
Show resolved Hide resolved
merge_group:
branches:
- main
push:
branches:
- main
paths:
- .github/workflows/build-android.yml
- android/**
- example/package.json
- example/android/**

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
75 changes: 75 additions & 0 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Test iOS build
on:
pull_request:
paths:
- .github/workflows/build-ios.yml
- RNLiveMarkdown.podspec
- ios/**
- example/package.json
- example/ios/**
merge_group:
branches:
- main
push:
branches:
- main
paths:
- .github/workflows/build-ios.yml
- RNLiveMarkdown.podspec
- ios/**
- 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-
tomekzaw marked this conversation as resolved.
Show resolved Hide resolved

- 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
39 changes: 39 additions & 0 deletions .github/workflows/build-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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: Install WebExample node_modules
working-directory: WebExample
run: npm ci

- name: Build app
working-directory: WebExample
run: npx expo export:web
64 changes: 64 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
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: Install parser node_modules
working-directory: parser
run: npm ci

- name: Install WebExample node_modules
working-directory: WebExample
run: npm ci

- name: Verify there's no parser diff
working-directory: parser
run: |
npm run build
if ! git diff --name-only --exit-code; then
# shellcheck disable=SC2016
echo 'Error: Parser diff detected! Please run `cd parser && npm run 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: 8 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ buildscript {
}
}

def reactNativeArchitectures() {
j-piasecki marked this conversation as resolved.
Show resolved Hide resolved
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}

def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
}
Expand Down Expand Up @@ -53,12 +58,13 @@ android {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

consumerProguardFiles "proguard-rules.pro"

externalNativeBuild {
cmake {
arguments "-DANDROID_STL=c++_shared", "-DANDROID_TOOLCHAIN=clang"
abiFilters (*reactNativeArchitectures())
}
}
}
Expand Down
103 changes: 103 additions & 0 deletions example/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.7)
base64
nkf
rexml
activesupport (7.0.8.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.2.0)
claide (1.1.0)
cocoapods (1.14.3)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.14.3)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.14.3)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.2.3)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.16.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.4)
concurrent-ruby (~> 1.0)
json (2.7.2)
minitest (5.22.3)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.2.6)
ruby-macho (2.5.1)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.24.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)

PLATFORMS
ruby

DEPENDENCIES
activesupport (>= 6.1.7.5, < 7.1.0)
cocoapods (>= 1.13, < 1.15)

RUBY VERSION
ruby 2.7.8p225

BUNDLED WITH
2.1.4
Loading
Loading