Move test-docker-android from GH Actions to CircleCI (#36093)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36093

The Test Docker Android job is flaky as sometimes fetching artifacts from remote
returns different hashes.
I'm moving the job to CircleCI (so it's faster) + I'm using the `buck_fetch.sh`
script we already have which has a retry logic.

Changelog:
[Internal] [Changed] - Move test-docker-android from GH Actions to CircleCI

Reviewed By: javache

Differential Revision: D43121477

fbshipit-source-id: 1df114fd3ad9445a4a5dc7834bf811c3476322cd
This commit is contained in:
Nicola Corti
2023-02-08 12:51:09 -08:00
committed by Facebook GitHub Bot
parent 69f11cbc1a
commit 9eaf6f5bdb
5 changed files with 17 additions and 36 deletions
+2 -8
View File
@@ -33,17 +33,11 @@ ADD React /app/React
ADD keystores /app/keystores
ADD packages/react-native-codegen /app/packages/react-native-codegen
ADD tools /app/tools
add scripts /app/scripts
ADD scripts /app/scripts
WORKDIR /app
RUN scripts/download-kotlin-compiler-with-buck.sh
RUN buck fetch ReactAndroid/src/test/java/com/facebook/react/modules
RUN buck fetch ReactAndroid/src/main/java/com/facebook/react
RUN buck fetch ReactAndroid/src/main/java/com/facebook/react/shell
RUN buck fetch ReactAndroid/src/test/...
RUN buck fetch ReactAndroid/src/androidTest/...
RUN scripts/buck/buck_fetch.sh
RUN buck build ReactAndroid/src/main/java/com/facebook/react
RUN buck build ReactAndroid/src/main/java/com/facebook/react/shell
+14 -1
View File
@@ -681,7 +681,7 @@ jobs:
- run:
name: Download Dependencies Using Buck
command: ./scripts/circleci/buck_fetch.sh
command: ./scripts/buck/buck_fetch.sh
- run:
name: Build & Test React Native using Buck
@@ -754,6 +754,18 @@ jobs:
- run_e2e:
platform: android
# -------------------------
# JOBS: Test Android Docker Image
# -------------------------
test_android_docker_image:
machine:
image: ubuntu-2004:202010-01
steps:
- checkout
- run:
name: Try to build React Native inside the Docker Container
command: npm run docker-build-android
# -------------------------
# JOBS: Test Android Template
# -------------------------
@@ -1603,6 +1615,7 @@ workflows:
run_disabled_tests: false
- test_android:
run_disabled_tests: false
- test_android_docker_image
- test_android_template:
requires:
- build_npm_package
-26
View File
@@ -1,26 +0,0 @@
name: Test Docker Android Image
# This workflow is triggered on commits to main and pull requests.
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
test-docker-android:
name: Test Docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Free up space by removing unnecessary folders
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Build Docker image with Android test app
run: npm run docker-build-android
@@ -44,7 +44,7 @@ function retry {
CURRENT_DIR=$(pwd)
export KOTLIN_HOME="$CURRENT_DIR/third-party/kotlin"
retry 3 scripts/download-kotlin-compiler-with-buck.sh
retry 3 scripts/buck/download-kotlin-compiler-with-buck.sh
retry 3 buck fetch ReactAndroid/src/test/java/com/facebook/react/modules
retry 3 buck fetch ReactAndroid/src/main/java/com/facebook/react