Skip to content

Commit 0a6e54b

Browse files
Add GitHub Actions for library and example apps (#134)
Co-authored-by: Tomek Zawadzki <tomekzawadzki98@gmail.com>
1 parent ee2daf7 commit 0a6e54b

File tree

10 files changed

+394
-82
lines changed

10 files changed

+394
-82
lines changed

.github/workflows/build-android.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Test Android build
2+
on:
3+
pull_request:
4+
paths:
5+
- .github/workflows/build-android.yml
6+
- android/**
7+
- cpp/**
8+
- example/package.json
9+
- example/android/**
10+
- react-native.config.js
11+
merge_group:
12+
branches:
13+
- main
14+
push:
15+
branches:
16+
- main
17+
paths:
18+
- .github/workflows/build-android.yml
19+
- android/**
20+
- cpp/**
21+
- example/package.json
22+
- example/android/**
23+
- react-native.config.js
24+
25+
jobs:
26+
build:
27+
if: github.repository == 'Expensify/react-native-live-markdown'
28+
runs-on: ubuntu-latest
29+
concurrency:
30+
group: build-android-${{ github.ref }}
31+
cancel-in-progress: true
32+
steps:
33+
- name: Check out Git repository
34+
uses: actions/checkout@v4
35+
36+
- name: Setup Java 17
37+
uses: actions/setup-java@v4
38+
with:
39+
distribution: 'zulu'
40+
java-version: 17
41+
42+
- name: Install node_modules
43+
run: yarn install --immutable
44+
45+
- name: Build app
46+
working-directory: example/android
47+
run: ./gradlew assembleDebug --build-cache -PreactNativeArchitectures=arm64-v8a

.github/workflows/build-ios.yml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Test iOS build
2+
on:
3+
pull_request:
4+
paths:
5+
- .github/workflows/build-ios.yml
6+
- RNLiveMarkdown.podspec
7+
- ios/**
8+
- cpp/**
9+
- example/package.json
10+
- example/ios/**
11+
merge_group:
12+
branches:
13+
- main
14+
push:
15+
branches:
16+
- main
17+
paths:
18+
- .github/workflows/build-ios.yml
19+
- RNLiveMarkdown.podspec
20+
- ios/**
21+
- cpp/**
22+
- example/package.json
23+
- example/ios/**
24+
25+
jobs:
26+
build:
27+
if: github.repository == 'Expensify/react-native-live-markdown'
28+
runs-on: macos-13
29+
concurrency:
30+
group: build-ios-${{ github.ref }}
31+
cancel-in-progress: true
32+
steps:
33+
- name: Check out Git repository
34+
uses: actions/checkout@v4
35+
36+
- name: Restore node_modules from cache
37+
uses: actions/cache@v4
38+
with:
39+
path: |
40+
node_modules
41+
example/node_modules
42+
key: build-ios-node-modules-${{ hashFiles('yarn.lock') }}
43+
restore-keys: build-ios-node-modules-
44+
45+
- name: Install node_modules
46+
run: yarn install --immutable
47+
48+
- name: Restore Pods from cache
49+
uses: actions/cache@v4
50+
with:
51+
path: |
52+
example/ios/Pods
53+
~/Library/Caches/CocoaPods
54+
~/.cocoapods
55+
key: build-ios-pods-${{ hashFiles('example/ios/Podfile.lock') }}
56+
restore-keys: build-ios-pods-
57+
58+
- name: Install Pods
59+
working-directory: example/ios
60+
run: |
61+
bundler install
62+
bundler exec pod install
63+
64+
- name: Remove .xcode.env.local
65+
working-directory: example/ios
66+
run: rm -rf .xcode.env.local
67+
68+
- name: Restore build artifacts from cache
69+
uses: actions/cache@v4
70+
with:
71+
path: ~/Library/Developer/Xcode/DerivedData
72+
key: build-ios-derived-data-${{ hashFiles('example/ios/Podfile.lock') }}
73+
restore-keys: build-ios-derived-data-
74+
75+
- name: Build app
76+
working-directory: example
77+
run: npx react-native@latest run-ios --no-packager

.github/workflows/build-web.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test web build
2+
on:
3+
pull_request:
4+
paths:
5+
- .github/workflows/build-web.yml
6+
- src/**
7+
- WebExample/**
8+
merge_group:
9+
branches:
10+
- main
11+
push:
12+
branches:
13+
- main
14+
paths:
15+
- .github/workflows/build-web.yml
16+
- src/**
17+
- WebExample/**
18+
19+
jobs:
20+
build:
21+
if: github.repository == 'Expensify/react-native-live-markdown'
22+
runs-on: ubuntu-latest
23+
concurrency:
24+
group: build-web-${{ github.ref }}
25+
cancel-in-progress: true
26+
steps:
27+
- name: Check out Git repository
28+
uses: actions/checkout@v4
29+
30+
- name: Install node_modules
31+
run: yarn install --immutable
32+
33+
- name: Install WebExample node_modules
34+
working-directory: WebExample
35+
run: npm ci
36+
37+
- name: Build app
38+
working-directory: WebExample
39+
run: npx expo export:web

.github/workflows/check.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Typecheck, lint and test
2+
on:
3+
pull_request:
4+
merge_group:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
check:
13+
if: github.repository == 'Expensify/react-native-live-markdown'
14+
runs-on: ubuntu-latest
15+
concurrency:
16+
group: check-root-${{ github.ref }}
17+
cancel-in-progress: true
18+
steps:
19+
- name: Check out Git repository
20+
uses: actions/checkout@v4
21+
22+
- name: Use Node.js 18
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 18
26+
27+
- name: Install node_modules
28+
run: yarn install --immutable
29+
30+
- name: Install parser node_modules
31+
working-directory: parser
32+
run: npm ci
33+
34+
- name: Install WebExample node_modules
35+
working-directory: WebExample
36+
run: npm ci
37+
38+
- name: Verify there's no parser diff
39+
working-directory: parser
40+
run: |
41+
npm run build
42+
if ! git diff --name-only --exit-code; then
43+
# shellcheck disable=SC2016
44+
echo 'Error: Parser diff detected! Please run `cd parser && npm run build` and commit the changes.'
45+
exit 1
46+
fi
47+
48+
- name: Typecheck library
49+
run: yarn tsc --project tsconfig.json --noEmit
50+
51+
- name: Typecheck parser
52+
run: yarn tsc --project parser/tsconfig.json --noEmit
53+
54+
- name: Typecheck example app
55+
run: yarn tsc --project example/tsconfig.json --noEmit
56+
57+
- name: Typecheck WebExample app
58+
run: yarn tsc --project WebExample/tsconfig.json --noEmit
59+
60+
- name: Lint
61+
run: yarn lint
62+
63+
- name: Test
64+
run: yarn test

example/Gemfile.lock

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
7+
rexml
8+
activesupport (7.0.8.1)
9+
concurrent-ruby (~> 1.0, >= 1.0.2)
10+
i18n (>= 1.6, < 2)
11+
minitest (>= 5.1)
12+
tzinfo (~> 2.0)
13+
addressable (2.8.6)
14+
public_suffix (>= 2.0.2, < 6.0)
15+
algoliasearch (1.27.5)
16+
httpclient (~> 2.8, >= 2.8.3)
17+
json (>= 1.5.1)
18+
atomos (0.1.3)
19+
base64 (0.2.0)
20+
claide (1.1.0)
21+
cocoapods (1.14.3)
22+
addressable (~> 2.8)
23+
claide (>= 1.0.2, < 2.0)
24+
cocoapods-core (= 1.14.3)
25+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
26+
cocoapods-downloader (>= 2.1, < 3.0)
27+
cocoapods-plugins (>= 1.0.0, < 2.0)
28+
cocoapods-search (>= 1.0.0, < 2.0)
29+
cocoapods-trunk (>= 1.6.0, < 2.0)
30+
cocoapods-try (>= 1.1.0, < 2.0)
31+
colored2 (~> 3.1)
32+
escape (~> 0.0.4)
33+
fourflusher (>= 2.3.0, < 3.0)
34+
gh_inspector (~> 1.0)
35+
molinillo (~> 0.8.0)
36+
nap (~> 1.0)
37+
ruby-macho (>= 2.3.0, < 3.0)
38+
xcodeproj (>= 1.23.0, < 2.0)
39+
cocoapods-core (1.14.3)
40+
activesupport (>= 5.0, < 8)
41+
addressable (~> 2.8)
42+
algoliasearch (~> 1.0)
43+
concurrent-ruby (~> 1.1)
44+
fuzzy_match (~> 2.0.4)
45+
nap (~> 1.0)
46+
netrc (~> 0.11)
47+
public_suffix (~> 4.0)
48+
typhoeus (~> 1.0)
49+
cocoapods-deintegrate (1.0.5)
50+
cocoapods-downloader (2.1)
51+
cocoapods-plugins (1.0.0)
52+
nap
53+
cocoapods-search (1.0.1)
54+
cocoapods-trunk (1.6.0)
55+
nap (>= 0.8, < 2.0)
56+
netrc (~> 0.11)
57+
cocoapods-try (1.2.0)
58+
colored2 (3.1.2)
59+
concurrent-ruby (1.2.3)
60+
escape (0.0.4)
61+
ethon (0.16.0)
62+
ffi (>= 1.15.0)
63+
ffi (1.16.3)
64+
fourflusher (2.3.1)
65+
fuzzy_match (2.0.4)
66+
gh_inspector (1.1.3)
67+
httpclient (2.8.3)
68+
i18n (1.14.4)
69+
concurrent-ruby (~> 1.0)
70+
json (2.7.2)
71+
minitest (5.22.3)
72+
molinillo (0.8.0)
73+
nanaimo (0.3.0)
74+
nap (1.1.0)
75+
netrc (0.11.0)
76+
nkf (0.2.0)
77+
public_suffix (4.0.7)
78+
rexml (3.2.6)
79+
ruby-macho (2.5.1)
80+
typhoeus (1.4.1)
81+
ethon (>= 0.9.0)
82+
tzinfo (2.0.6)
83+
concurrent-ruby (~> 1.0)
84+
xcodeproj (1.24.0)
85+
CFPropertyList (>= 2.3.3, < 4.0)
86+
atomos (~> 0.1.3)
87+
claide (>= 1.0.2, < 2.0)
88+
colored2 (~> 3.1)
89+
nanaimo (~> 0.3.0)
90+
rexml (~> 3.2.4)
91+
92+
PLATFORMS
93+
ruby
94+
95+
DEPENDENCIES
96+
activesupport (>= 6.1.7.5, < 7.1.0)
97+
cocoapods (>= 1.13, < 1.15)
98+
99+
RUBY VERSION
100+
ruby 2.7.8p225
101+
102+
BUNDLED WITH
103+
2.1.4

0 commit comments

Comments
 (0)