Skip to content

Commit 7b8f207

Browse files
committed
v2
1 parent 2c106dd commit 7b8f207

File tree

4 files changed

+35
-8
lines changed

4 files changed

+35
-8
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ jobs:
2222
- name: Build Docker image
2323
run: docker build --tag $IMAGE_TAG .
2424

25+
- name: Check if Emulator (Headless) starts
26+
run: docker run --rm -v "${GITHUB_WORKSPACE}/scripts/":/scripts $IMAGE_TAG /bin/sh -c "/scripts/test-emulator-headless.sh"
27+
2528
- name: Checkout React Native
2629
uses: actions/checkout@v2
2730
with:
2831
repository: facebook/react-native
2932
path: react-native
3033

3134
- name: Build React Native
32-
run: |
33-
docker run --rm -v "${GITHUB_WORKSPACE}/react-native/":/pwd -w /pwd $IMAGE_TAG /bin/sh -c \
34-
"yarn install && ./gradlew --no-daemon :packages:rn-tester:android:app:assembleRelease && ./scripts/circleci/buck_fetch.sh"
35+
run: docker run --rm -v "${GITHUB_WORKSPACE}/scripts/":/scripts -v "${GITHUB_WORKSPACE}/react-native/":/react-native -w /react-native $IMAGE_TAG /bin/sh -c "/scripts/test-react-native-setup.sh"

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@ RUN apt update -qq && apt install -qq -y --no-install-recommends \
3030
build-essential \
3131
file \
3232
git \
33-
cmake \
34-
ruby-full \
35-
openjdk-8-jdk \
3633
gnupg2 \
37-
python \
38-
python3-distutils \
34+
libc++1-10 \
35+
libgl1 \
36+
libtcmalloc-minimal4 \
37+
openjdk-8-jdk-headless \
3938
openssh-client \
39+
python3 \
40+
python3-distutils \
4041
rsync \
42+
ruby \
43+
ruby-dev \
4144
unzip \
4245
&& gem install bundler \
4346
&& rm -rf /var/lib/apt/lists/*;

scripts/test-emulator-headless.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
echo no | avdmanager create avd -n testEmulator -k "system-images;android-21;google_apis;armeabi-v7a"
4+
emulator -avd testEmulator -no-audio -no-cache -no-snapshot -no-window &
5+
6+
echo "Waiting until the device is ready"
7+
adb wait-for-device
8+
9+
echo "The device is ready"
10+
adb shell input keyevent 82

scripts/test-react-native-setup.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
echo "Check Buck setup"
4+
./scripts/circleci/buck_fetch.sh
5+
buck build ReactAndroid/src/main/java/com/facebook/react
6+
buck build ReactAndroid/src/main/java/com/facebook/react/shell
7+
8+
echo "Build React Native"
9+
yarn install
10+
./gradlew --no-daemon :ReactAndroid:packageReactNdkLibsForBuck
11+
12+
echo "Assemble RNTester app"
13+
./gradlew --no-daemon :packages:rn-tester:android:app:assembleRelease

0 commit comments

Comments
 (0)