From ec445b5c73c05080b15a2fd9a07b5dae413a478b Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 1 Mar 2018 07:15:30 -0800 Subject: [PATCH] ci: speed up lint job on CircleCI (#22526) When I enabled bazel remote caching, I also switched to running buildifier and skylint from the package.json script, which builds them from head. With remote caching, we do get cache hits for these, but looking up the action inputs actually takes quite a bit of time since we have to first fetch the remote repository, then do loading and analysis, then read the inputs to determine the cache key. It's more important to keep the lint job fast, so I'm reverting that part of the change for now. We can experiment with building them from head in a less critical repo. PR Close #22526 --- .circleci/config.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a2d8f0dbf1..80335f00c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,14 +41,14 @@ jobs: steps: - checkout: <<: *post_checkout - # See remote cache documentation in /docs/BAZEL.md - - run: .circleci/setup_cache.sh - - run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc - - *setup-bazel-remote-cache - - run: 'yarn buildifier -mode=check || - (echo -e "\nBUILD files not formatted. Please run ''yarn buildifier''" ; exit 1)' - - run: 'yarn skylint || + # Check BUILD.bazel formatting before we have a node_modules directory + # Then we don't need any exclude pattern to avoid checking those files + - run: 'buildifier -mode=check $(find . -type f \( -name BUILD.bazel -or -name BUILD \)) || + (echo "BUILD files not formatted. Please run ''yarn buildifier''" ; exit 1)' + # Run the skylark linter to check our Bazel rules + - run: 'find . -type f -name "*.bzl" | + xargs java -jar /usr/local/bin/Skylint_deploy.jar || (echo -e "\n.bzl files have lint errors. Please run ''yarn skylint''"; exit 1)' - restore_cache: