Skip to content

Commit 3a3498b

Browse files
authored
Merge pull request #59 from talsec/add_ci
Add ci
2 parents 92367ce + 4b29ba7 commit 3a3498b

File tree

12 files changed

+1848
-3785
lines changed

12 files changed

+1848
-3785
lines changed

.github/actions/setup/action.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Setup
2+
description: Setup Node.js and install dependencies
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup Node.js
8+
uses: actions/setup-node@v4
9+
with:
10+
node-version: 20.x
11+
node-version-file: .nvmrc
12+
13+
- name: Cache dependencies
14+
id: yarn-cache
15+
uses: actions/cache@v4
16+
with:
17+
path: |
18+
**/node_modules
19+
.yarn/install-state.gz
20+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
21+
restore-keys: |
22+
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
23+
${{ runner.os }}-yarn-
24+
25+
- name: Install dependencies
26+
if: steps.yarn-cache.outputs.cache-hit != 'true'
27+
run: yarn install --immutable
28+
shell: bash
29+
30+
- name: Install dependencies in example
31+
if: steps.yarn-cache.outputs.cache-hit != 'true'
32+
working-directory: ./example
33+
run: yarn install --immutable
34+
shell: bash
35+

.github/workflows/ci.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup
18+
uses: ./.github/actions/setup
19+
20+
- name: Lint files
21+
run: yarn lint
22+
23+
- name: Typecheck files
24+
run: |
25+
yarn typecheck
26+
27+
- name: Typecheck Expo files
28+
run: |
29+
yarn expo:typecheck
30+
31+
# no tests yet 😥
32+
# test:
33+
# runs-on: ubuntu-latest
34+
# steps:
35+
# - name: Checkout
36+
# uses: actions/checkout@v4
37+
38+
# - name: Setup
39+
# uses: ./.github/actions/setup
40+
41+
# - name: Run unit tests
42+
# run: yarn test --maxWorkers=2 --coverage
43+
44+
build-library:
45+
runs-on: ubuntu-latest
46+
needs: [lint]
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
51+
- name: Setup
52+
uses: ./.github/actions/setup
53+
54+
- name: Build package
55+
run: yarn prepack
56+
57+
build-android:
58+
runs-on: ubuntu-latest
59+
needs: build-library
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
64+
- name: Setup
65+
uses: ./.github/actions/setup
66+
67+
- name: Install JDK
68+
uses: actions/setup-java@v4
69+
with:
70+
distribution: 'zulu'
71+
java-version: '17'
72+
73+
- name: Finalize Android SDK
74+
run: |
75+
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
76+
77+
- name: Cache Gradle
78+
uses: actions/cache@v4
79+
with:
80+
path: |
81+
~/.gradle/wrapper
82+
~/.gradle/caches
83+
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
84+
restore-keys: |
85+
${{ runner.os }}-gradle-
86+
87+
- name: Build example for Android
88+
env:
89+
JAVA_OPTS: "-XX:MaxHeapSize=6g"
90+
working-directory: ./example
91+
run: |
92+
yarn build:android
93+
94+
build-ios:
95+
runs-on: macos-14
96+
needs: build-library
97+
steps:
98+
- name: Checkout
99+
uses: actions/checkout@v4
100+
101+
- name: Setup Xcode version
102+
uses: maxim-lobanov/[email protected]
103+
with:
104+
xcode-version: '14.3.1'
105+
106+
107+
108+
- name: Setup
109+
uses: ./.github/actions/setup
110+
111+
- name: Install cocoapods
112+
run: |
113+
cd example/ios
114+
pod install
115+
116+
- name: Build example for iOS
117+
working-directory: ./example
118+
run: |
119+
yarn build:ios

.github/workflows/publish-release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ jobs:
7373
shell: bash
7474

7575
- name: Build Expo plugin
76-
working-directory: ./plugin
77-
run: tsc
76+
run: yarn build:plugin
7877
shell: bash
7978

8079
- name: Configure git

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
plugin/build

example/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module '*.png';

example/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"android": "react-native run-android",
77
"ios": "react-native run-ios",
88
"start": "react-native start",
9-
"pods": "pod-install --quiet"
9+
"pods": "pod-install --quiet",
10+
"build:android": "cd android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
11+
"build:ios": "cd ios && xcodebuild -workspace FreeraspReactNativeExample.xcworkspace -scheme FreeraspReactNativeExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO"
1012
},
1113
"dependencies": {
1214
"@react-native-material/core": "^1.3.7",
@@ -15,9 +17,9 @@
1517
"react-native-svg": "^13.8.0"
1618
},
1719
"devDependencies": {
18-
"@babel/core": "^7.12.9",
20+
"@babel/core": "^7.24.4",
1921
"@babel/runtime": "^7.24.1",
20-
"babel-plugin-module-resolver": "^4.1.0",
22+
"babel-plugin-module-resolver": "^5.0.0",
2123
"metro-react-native-babel-preset": "0.72.3",
2224
"react-native-svg-transformer": "^1.0.0"
2325
}

0 commit comments

Comments
 (0)