-
Notifications
You must be signed in to change notification settings - Fork 56
129 lines (100 loc) · 3.77 KB
/
react-native-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Storefront App CI
on:
pull_request:
branches: [main] # Trigger for PRs to main branch
env:
FLEETBASE_KEY: ${{ secrets.FLEETBASE_KEY }}
GOOGLE_MAPS_KEY: ${{ secrets.GOOGLE_MAPS_KEY }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
jobs:
install_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Install dependencies
run: npm install -g yarn
- name: Enable Corepack
run: corepack enable
- name: Activate Yarn 3.6.4
run: corepack prepare [email protected] --activate
- name: Install dependencies
run: yarn install
android_build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Generate google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.STOREFRONT_GOOGLE_SERVICES_JSON }}
run: |
echo "$GOOGLE_SERVICES_JSON" > google-services.json
mkdir -p android/app/src
mv google-services.json android/app/src
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Install dependencies
run: npm install -g yarn
- name: Enable Corepack
run: corepack enable
- name: Activate Yarn 3.6.4
run: corepack prepare [email protected] --activate
- name: Install dependencies
run: yarn install
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
- name: Cache Gradle Wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle Dependencies
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Make Gradlew Executable
run: cd android && chmod +x ./gradlew
- name: Build Android
run: cd android && ./gradlew assembleDebug
env:
JVM_OPTS: '-Xmx4096m'
ios_build:
runs-on: macOS-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install dependencies
run: npm install -g yarn
- name: Enable Corepack
run: corepack enable
- name: Activate Yarn 3.6.4
run: corepack prepare [email protected] --activate
- name: Install dependencies
run: yarn install
- name: Install CocoaPods
run: sudo gem install cocoapods
- name: Install iOS pods
run: cd ios && pod install
- name: Build iOS
run: npx react-native run-ios