diff --git a/.buildkite/basic/react-native-android-pipeline.yml b/.buildkite/basic/react-native-android-pipeline.yml index f65847bd07..b14f1079dc 100644 --- a/.buildkite/basic/react-native-android-pipeline.yml +++ b/.buildkite/basic/react-native-android-pipeline.yml @@ -13,6 +13,9 @@ steps: build: react-native-android-builder image-repository: 855461928731.dkr.ecr.us-west-1.amazonaws.com/js cache-from: react-native-android-builder:855461928731.dkr.ecr.us-west-1.amazonaws.com/js:ci-${BRANCH_NAME} + args: + - JAVA_VERSION=17 + - NODE_VERSION=18 - docker-compose#v4.12.0: push: react-native-android-builder:855461928731.dkr.ecr.us-west-1.amazonaws.com/js:ci-${BRANCH_NAME} retry: @@ -29,7 +32,6 @@ steps: - "android-builder-image" timeout_in_minutes: 60 env: - JAVA_VERSION: "17" REACT_NATIVE_VERSION: "rn0.73" RN_NEW_ARCH: "false" ARTEFACT_NAME: "rn0.73-old-arch" @@ -50,7 +52,6 @@ steps: - "android-builder-image" timeout_in_minutes: 60 env: - JAVA_VERSION: "17" REACT_NATIVE_VERSION: "rn0.73" RN_NEW_ARCH: "true" ARTEFACT_NAME: "rn0.73-new-arch" diff --git a/.buildkite/full/pipeline.full.yml b/.buildkite/full/pipeline.full.yml index 9a3da5b684..8e6f6c88ff 100644 --- a/.buildkite/full/pipeline.full.yml +++ b/.buildkite/full/pipeline.full.yml @@ -6,7 +6,7 @@ steps: - label: ":large_blue_circle: :large_blue_circle: :large_blue_circle: FULL REACT NATIVE (ANDROID) STEPS :large_blue_circle: :large_blue_circle: :large_blue_circle:" depends_on: - "publish-js" - - "android-builder-image" + - "android-builder-base" commands: - buildkite-agent pipeline upload .buildkite/full/react-native-android-pipeline.full.yml diff --git a/.buildkite/full/react-native-android-pipeline.full.yml b/.buildkite/full/react-native-android-pipeline.full.yml index d82fba5ac3..3361b989c6 100644 --- a/.buildkite/full/react-native-android-pipeline.full.yml +++ b/.buildkite/full/react-native-android-pipeline.full.yml @@ -2,13 +2,34 @@ steps: - group: "React Native (Android) Tests" steps: + # + # Android builder + # + - label: ":docker: Build legacy RN Android Builder image (Java 11, Node 16)" + key: "android-builder-image-legacy" + timeout_in_minutes: 30 + plugins: + - docker-compose#v4.12.0: + build: react-native-android-builder + image-repository: 855461928731.dkr.ecr.us-west-1.amazonaws.com/js + cache-from: react-native-android-builder:855461928731.dkr.ecr.us-west-1.amazonaws.com/js:ci-${BRANCH_NAME}-jdk11-node16 + args: + - JAVA_VERSION=11 + - NODE_VERSION=16 + - docker-compose#v4.12.0: + push: react-native-android-builder:855461928731.dkr.ecr.us-west-1.amazonaws.com/js:ci-${BRANCH_NAME}-jdk11-node16 + retry: + automatic: + - exit_status: "*" + limit: 1 + # # Test fixtures # - label: ":android: Build RN 0.60 apk" key: "rn-0-60-apk" depends_on: - - "android-builder-image" + - "android-builder-image-legacy" timeout_in_minutes: 60 env: REACT_NATIVE_VERSION: "rn0.60" @@ -27,7 +48,7 @@ steps: - label: ":android: Build RN 0.66 apk" key: "rn-0-66-apk" depends_on: - - "android-builder-image" + - "android-builder-image-legacy" timeout_in_minutes: 60 env: REACT_NATIVE_VERSION: "rn0.66" @@ -45,7 +66,7 @@ steps: - label: ":android: Build RN 0.67 apk" key: "rn-0-67-apk" depends_on: - - "android-builder-image" + - "android-builder-image-legacy" timeout_in_minutes: 60 env: REACT_NATIVE_VERSION: "rn0.67" @@ -63,7 +84,7 @@ steps: - label: ":android: Build RN 0.68 Hermes apk" key: "rn-0-68-hermes-apk" depends_on: - - "android-builder-image" + - "android-builder-image-legacy" timeout_in_minutes: 60 env: REACT_NATIVE_VERSION: "rn0.68-hermes" @@ -81,7 +102,7 @@ steps: - label: ":android: Build RN 0.69 apk" key: "rn-0-69-apk" depends_on: - - "android-builder-image" + - "android-builder-image-legacy" timeout_in_minutes: 60 env: REACT_NATIVE_VERSION: "rn0.69" @@ -99,7 +120,7 @@ steps: - label: ":android: Build RN 0.71 (Old Arch) apk" key: "rn-0-71-old-arch-apk" depends_on: - - "android-builder-image" + - "android-builder-image-legacy" timeout_in_minutes: 60 env: REACT_NATIVE_VERSION: "rn0.71" @@ -119,7 +140,7 @@ steps: - label: ":android: Build RN 0.71 (New Arch) apk" key: "rn-0-71-new-arch-apk" depends_on: - - "android-builder-image" + - "android-builder-image-legacy" timeout_in_minutes: 60 env: REACT_NATIVE_VERSION: "rn0.71" @@ -139,7 +160,7 @@ steps: - label: ":android: Build react-navigation 0.60 apk" key: "react-navigation-0-60-apk" depends_on: - - "android-builder-image" + - "android-builder-image-legacy" timeout_in_minutes: 60 env: REACT_NATIVE_VERSION: "rn0.60" @@ -159,7 +180,7 @@ steps: - label: ":android: Build react-navigation 0.69 apk" key: "react-navigation-0-69-apk" depends_on: - - "android-builder-image" + - "android-builder-image-legacy" timeout_in_minutes: 60 env: REACT_NATIVE_VERSION: "rn0.69" @@ -179,7 +200,7 @@ steps: - label: ":android: Build react-native-navigation 0.60 apk" key: "react-native-navigation-0-60-apk" depends_on: - - "android-builder-image" + - "android-builder-image-legacy" timeout_in_minutes: 60 env: REACT_NATIVE_VERSION: "rn0.60" @@ -199,7 +220,7 @@ steps: - label: ":android: Build react-native-navigation 0.66 apk" key: "react-native-navigation-0-66-apk" depends_on: - - "android-builder-image" + - "android-builder-image-legacy" timeout_in_minutes: 60 env: REACT_NATIVE_VERSION: "rn0.66" diff --git a/.buildkite/full/react-native-cli-pipeline.full.yml b/.buildkite/full/react-native-cli-pipeline.full.yml index b568006446..4d50b3ccaa 100644 --- a/.buildkite/full/react-native-cli-pipeline.full.yml +++ b/.buildkite/full/react-native-cli-pipeline.full.yml @@ -201,6 +201,8 @@ steps: build: react-native-cli-android-builder image-repository: 855461928731.dkr.ecr.us-west-1.amazonaws.com/js cache-from: react-native-cli-android-builder:855461928731.dkr.ecr.us-west-1.amazonaws.com/js:ci-${BRANCH_NAME} + args: + - JAVA_VERSION=11 - docker-compose#v4.12.0: push: react-native-cli-android-builder:855461928731.dkr.ecr.us-west-1.amazonaws.com/js:ci-${BRANCH_NAME} retry: diff --git a/docker-compose.yml b/docker-compose.yml index 314836612c..96e2f8cfa9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -126,17 +126,18 @@ services: - REG_BASIC_CREDENTIAL - REG_NPM_EMAIL - MAVEN_REPO_URL + - JAVA_VERSION + - NODE_VERSION environment: - DEBUG: - BRANCH_NAME: - BUILDKITE: - REGISTRY_URL: - REACT_NATIVE_VERSION: - RN_NEW_ARCH: - NOTIFIER_VERSION: - ARTEFACT_NAME: - JS_SOURCE_DIR: - JAVA_VERSION: "${JAVA_VERSION:-11}" + - DEBUG + - BRANCH_NAME + - BUILDKITE + - REGISTRY_URL + - REACT_NATIVE_VERSION + - RN_NEW_ARCH + - NOTIFIER_VERSION + - ARTEFACT_NAME + - JS_SOURCE_DIR networks: default: aliases: @@ -170,6 +171,7 @@ services: - REGISTRY_URL - REG_BASIC_CREDENTIAL - REG_NPM_EMAIL + - JAVA_VERSION environment: - VERBOSE - DEBUG diff --git a/dockerfiles/Dockerfile.android-builder-base b/dockerfiles/Dockerfile.android-builder-base index 31f9d6a743..9c39c4636f 100644 --- a/dockerfiles/Dockerfile.android-builder-base +++ b/dockerfiles/Dockerfile.android-builder-base @@ -2,7 +2,6 @@ FROM openjdk:11-jdk-bullseye as java-11 FROM openjdk:17-jdk-bullseye COPY --from=java-11 /usr/local/openjdk-11 /usr/local/openjdk-11 -ENV JAVA_HOME=/usr/local/openjdk-11 # OS setup RUN apt-get update && apt-get install -y gradle jq git-core build-essential openssl libssl-dev diff --git a/dockerfiles/Dockerfile.react-native-android-builder b/dockerfiles/Dockerfile.react-native-android-builder index a8eb3e1298..b50d0e93e9 100644 --- a/dockerfiles/Dockerfile.react-native-android-builder +++ b/dockerfiles/Dockerfile.react-native-android-builder @@ -1,6 +1,11 @@ FROM 855461928731.dkr.ecr.us-west-1.amazonaws.com/js:android-builder-base -RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - +# Java version +ARG JAVA_VERSION +ENV JAVA_HOME=/usr/local/openjdk-${JAVA_VERSION} + +ARG NODE_VERSION +RUN curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - RUN apt-get install -y nodejs rsync RUN npm i -g run-func @@ -29,4 +34,4 @@ COPY lerna.json . COPY scripts/common.js scripts/react-native-helper.js scripts/ # Do a full build by running the container -CMD JAVA_HOME=/usr/local/openjdk-${JAVA_VERSION} run-func scripts/react-native-helper.js buildAndroid "/app/test/react-native/features/fixtures" "/app/features/fixtures" +CMD run-func scripts/react-native-helper.js buildAndroid "/app/test/react-native/features/fixtures" "/app/features/fixtures" diff --git a/dockerfiles/Dockerfile.react-native-cli-android-builder b/dockerfiles/Dockerfile.react-native-cli-android-builder index 7ef762d2f4..4a7bae8e57 100644 --- a/dockerfiles/Dockerfile.react-native-cli-android-builder +++ b/dockerfiles/Dockerfile.react-native-cli-android-builder @@ -1,5 +1,9 @@ FROM 855461928731.dkr.ecr.us-west-1.amazonaws.com/js:android-builder-base +# Java version +ARG JAVA_VERSION +ENV JAVA_HOME=/usr/local/openjdk-${JAVA_VERSION} + RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - RUN apt-get update && apt-get install -y nodejs rsync expect \ # Dependencies for MazeRunner