Skip to content

Commit ad38ad6

Browse files
authored
Merge pull request #9 from callstack-internal/ft/add-CI
Add CI/CD
2 parents 8b7071f + 865a41e commit ad38ad6

File tree

22 files changed

+606
-107
lines changed

22 files changed

+606
-107
lines changed

.github/workflows/pr-checks.yml

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
validate:
9+
name: Validate and Test
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '18'
18+
cache: 'yarn'
19+
20+
- name: Install dependencies
21+
run: yarn install --frozen-lockfile
22+
23+
- name: TypeScript Check
24+
run: yarn tsc --noEmit
25+
26+
- name: Lint
27+
run: yarn lint
28+
29+
- name: Run Tests
30+
run: yarn test
31+
32+
build-android:
33+
name: Build Android
34+
runs-on: ubuntu-latest
35+
environment: production
36+
env:
37+
NODE_ENV: production
38+
WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }}
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Setup Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: '18'
46+
cache: 'yarn'
47+
48+
- name: Setup Ruby
49+
uses: ruby/setup-ruby@v1
50+
with:
51+
ruby-version: '3.2'
52+
bundler-cache: true
53+
working-directory: android
54+
55+
- name: Install dependencies
56+
run: |
57+
yarn install --frozen-lockfile
58+
yarn cache clean
59+
rm -rf node_modules/.cache/metro
60+
61+
- name: Setup Java
62+
uses: actions/setup-java@v4
63+
with:
64+
distribution: 'zulu'
65+
java-version: '17'
66+
67+
- name: Install Fastlane
68+
working-directory: android
69+
run: bundle install
70+
71+
- name: Build Android with Fastlane
72+
working-directory: android
73+
run: |
74+
echo "WEATHER_API_KEY=${{ secrets.WEATHER_API_KEY }}" > ../.env
75+
bundle exec fastlane build_android
76+
77+
build-ios:
78+
name: Build iOS
79+
runs-on: macos-13
80+
environment: production
81+
env:
82+
NODE_ENV: production
83+
WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }}
84+
steps:
85+
- uses: actions/checkout@v4
86+
87+
- name: Setup Node.js
88+
uses: actions/setup-node@v4
89+
with:
90+
node-version: '18'
91+
cache: 'yarn'
92+
93+
- name: Install dependencies
94+
run: |
95+
yarn install --frozen-lockfile
96+
yarn cache clean
97+
rm -rf node_modules/.cache/metro
98+
99+
- name: Setup Ruby
100+
uses: ruby/setup-ruby@v1
101+
with:
102+
ruby-version: '3.2'
103+
bundler-cache: true
104+
working-directory: ios
105+
106+
- name: Select Xcode Version
107+
run: |
108+
sudo xcode-select -p
109+
sudo xcode-select -s /Applications/Xcode_15.2.app
110+
xcodebuild -version
111+
112+
- name: Update Fastlane
113+
working-directory: ios
114+
run: |
115+
bundle update fastlane
116+
bundle install
117+
118+
- name: Install CocoaPods
119+
run: |
120+
cd ios
121+
pod deintegrate
122+
pod install
123+
124+
- name: Build iOS with Fastlane
125+
working-directory: ios
126+
run: |
127+
echo "WEATHER_API_KEY=${{ secrets.WEATHER_API_KEY }}" > ../.env
128+
bundle exec fastlane build_ios

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ yarn-error.log
5151
**/fastlane/Preview.html
5252
**/fastlane/screenshots
5353
**/fastlane/test_output
54+
ios/fastlane/
5455

5556
# Bundle artifact
5657
*.jsbundle

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ ruby ">= 2.6.10"
77
# bound in the template on Cocoapods with next React Native release.
88
gem 'cocoapods', '>= 1.13', '< 1.15'
99
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
10+
gem "fastlane"

0 commit comments

Comments
 (0)