Skip to content

Commit

Permalink
Downscale and move to a prebuilt-image analyze code/pr (#38819)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #38819

The jobs for `analyze_pr` and `analyze_code` are currently running on Android's Docker container on a XL instance. This is costly. As those jobs are relatively small, not on the critical path, and need the Android container only for `java`, I've moved the to the node-broswers CI executor:
https://circleci.com/developer/images/image/cimg/node

Changelog:
[Internal] [Changed] - Downscale and move to a prebuilt-image analyze code/pr

Reviewed By: cipolleschi

Differential Revision: D48116159

fbshipit-source-id: a12782b810fb225ab6916a35054a891e73f3a717
  • Loading branch information
cortinico authored and facebook-github-bot committed Aug 7, 2023
1 parent 8a44520 commit 2bf59c7
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ references:
xcode_version: &xcode_version "14.3.0"
nodelts_image: &nodelts_image "cimg/node:20.2.0"
nodeprevlts_image: &nodeprevlts_image "cimg/node:18.12.1"
nodelts_browser_image: &nodelts_browser_image "cimg/node:20.2.0-browsers"

# -------------------------
# Cache Key Anchors
Expand All @@ -62,7 +63,7 @@ references:
checkout_cache_key: &checkout_cache_key v1-checkout
gems_cache_key: &gems_cache_key v1-gems-{{ checksum "Gemfile.lock" }}
gradle_cache_key: &gradle_cache_key v2-gradle-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "packages/react-native/ReactAndroid/gradle.properties" }}
yarn_cache_key: &yarn_cache_key v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}
yarn_cache_key: &yarn_cache_key v6-yarn-cache-{{ .Environment.CIRCLE_JOB }}
rbenv_cache_key: &rbenv_cache_key v1-rbenv-{{ checksum "/tmp/required_ruby" }}
hermes_workspace_cache_key: &hermes_workspace_cache_key v5-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
hermes_workspace_debug_cache_key: &hermes_workspace_debug_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }}
Expand Down Expand Up @@ -129,6 +130,12 @@ executors:
docker:
- image: *nodeprevlts_image
resource_class: "xlarge"
# Executor with Node & Java used to inspect and lint
node-browsers-small:
<<: *defaults
docker:
- image: *nodelts_browser_image
resource_class: "small"
reactnativeandroid:
<<: *defaults
docker:
Expand Down Expand Up @@ -610,7 +617,7 @@ jobs:
# Issues will be posted to the PR itself via GitHub bots.
# This workflow should only fail if the bots fail to run.
analyze_pr:
executor: reactnativeandroid
executor: node-browsers-small
steps:
- checkout
- run_yarn
Expand All @@ -622,7 +629,7 @@ jobs:
# JOBS: Analyze Code
# -------------------------
analyze_code:
executor: reactnativeandroid
executor: node-browsers-small
steps:
- checkout
- setup_artifacts
Expand All @@ -638,6 +645,13 @@ jobs:
command: scripts/circleci/exec_swallow_error.sh yarn lint-java --check
when: always

- run:
name: Set server.max_workers=1 in .flowconfig
command: |
sed -i '/\[options\]/a server.max_workers=1' .flowconfig
sed -i '/\[options\]/a server.max_workers=1' .flowconfig.android
when: always

- run:
name: Check for errors in code using Flow (iOS)
command: yarn flow-check-ios
Expand Down

0 comments on commit 2bf59c7

Please sign in to comment.