Skip to content

Commit

Permalink
Update Circle CI config to run everything with Gradle (#696)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #696

Reviewed By: muraziz

Differential Revision: D23241604

fbshipit-source-id: e4b67ce6b9ea29a9d070fea1bd0d27d5a36b8e47
  • Loading branch information
colriot authored and facebook-github-bot committed Aug 20, 2020
1 parent ed9aa28 commit ecb1b21
Showing 1 changed file with 16 additions and 123 deletions.
139 changes: 16 additions & 123 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,6 @@ aliases:
# $HOME/litho-working-dir/workspace/buck/bin/buck fetch //... # explicitly exclude Kotlin modules until OSS BUCK config will be fixed
$HOME/litho-working-dir/workspace/buck/bin/buck fetch //:components sample sample-barebones sample-codelab litho-it/... litho-it-powermock/...
# Save Litho BUCK test results
- &save-litho-buck-tests-results
name: Save Litho BUCK tests results
command: |
cd workspace
mkdir -p junit
cd repo
find . -type f -name "litho-it*tests*.xml" -exec cp {} ~/litho-working-dir/workspace/junit/ \;
when: always

# Save Litho Gradle test results
- &save-litho-gradle-tests-results
name: Save Litho Gradle tests results
Expand Down Expand Up @@ -164,50 +154,6 @@ commands:
- restore_cache: *restore-cache-android-packages
- run: *setup-buck

buck_build:
description: "A command that uses BUCK for builds"
parameters:
module_name:
type: string
steps:
- attach_restore_setup_buck
- run:
name: Build <<parameters.module_name>> with BUCK
command: |
cd workspace/repo
buck fetch <<parameters.module_name>>
buck build <<parameters.module_name>> --num-threads=4
gradle_build:
description: "A command that uses Gradle for builds"
parameters:
module_name:
type: string
steps:
- attach_restore_setup_buck
- run:
name: Build <<parameters.module_name>> with Gradle
command: |
cd workspace/repo
./gradlew :<<parameters.module_name>>:assembleDebug --no-daemon --max-workers 2
buck_tests:
description: "A command that runs tests using BUCK"
parameters:
module_name:
type: string
steps:
- attach_restore_setup_buck
- run:
name: Run <<parameters.module_name>> tests with BUCK
command: |
cd workspace/repo
buck fetch <<parameters.module_name>>/...
buck test <<parameters.module_name>>/src/test/... --num-threads=4 --xml <<parameters.module_name>>_tests.xml
- run: *save-litho-buck-tests-results
- *store_litho_tests_results
- *store_litho_artifacts

jobs:
checkout_code:
executor: litho-executor
Expand Down Expand Up @@ -247,58 +193,25 @@ jobs:
paths:
- repo

build:
setup_deps:
executor: litho-executor
steps:
- attach_restore_setup_buck
- run: *download-buck-dependencies
- run: *download-gradle-dependencies
- save_cache: *save-repo-cache

buck_sample_build:
executor: litho-executor
steps:
- buck_build:
module_name: "sample"

buck_sample_barebones_build:
executor: litho-executor
steps:
- buck_build:
module_name: "sample-barebones"

buck_sample_codelab_build:
executor: litho-executor
steps:
- buck_build:
module_name: "sample-codelab"

gradle_sample_build:
executor: litho-executor
steps:
- gradle_build:
module_name: "sample"

gradle_sample_kotlin_build:
executor: litho-executor
steps:
- gradle_build:
module_name: "sample-kotlin"


buck_litho_it_tests_run:
executor: litho-executor
steps:
- buck_tests:
module_name: "litho-it"

buck_litho_it_powermock_tests_run:
gradle_build:
executor: litho-executor
steps:
- buck_tests:
module_name: "litho-it-powermock"
- attach_restore_setup_buck
- run:
name: Build with Gradle
command: |
cd workspace/repo
./gradlew assemble --no-daemon --max-workers 2
gradle_tests_run:
gradle_tests:
executor: litho-executor
steps:
- attach_restore_setup_buck
Expand All @@ -324,42 +237,22 @@ jobs:
scripts/circle-ci-publish-snapshot.sh
workflows:
version: 2
version: 3
build_and_test:
jobs:
- checkout_code
- build:
- setup_deps:
requires:
- checkout_code
- buck_sample_build:
requires:
- build
- buck_sample_barebones_build:
requires:
- build
- buck_sample_codelab_build:
requires:
- build
- gradle_sample_build:
requires:
- build
- gradle_sample_kotlin_build:
requires:
- build
- buck_litho_it_tests_run:
requires:
- build
- buck_litho_it_powermock_tests_run:
- gradle_build:
requires:
- build
- gradle_tests_run:
- setup_deps
- gradle_tests:
requires:
- build
- setup_deps
- publish_snapshot:
requires:
- buck_litho_it_tests_run
- buck_litho_it_powermock_tests_run
- gradle_tests_run
- gradle_tests
filters:
branches:
only: master

0 comments on commit ecb1b21

Please sign in to comment.