[pancakes] Speed up (#29674)

* upgrade cache impl

* better cache

* run against right repo

* syntax

* speed fetch
pull/29616/head
Craig Tiller 3 years ago committed by GitHub
parent 03e9ac6f1f
commit a6ee377bc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      .github/workflows/pr-auto-fix.yaml
  2. 2
      tools/distrib/run_clang_tidy.py

@ -10,15 +10,25 @@ jobs:
id: current-time
with:
format: YYYYWW
- name: Get current time
uses: srfrnk/current-time@master
id: current-time-with-day
with:
format: YYYYWWd
- name: Cache bazel
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: bazel-cache
with:
path: ~/.cache/bazel
# formattedTime here is like 202132 - the year concatenated with the week
# as this changes every week, we cycle to a new cache once per week.
key: ${{ runner.os }}-${{ steps.current-time.outputs.formattedTime }}
# formattedTime here is like 2021323 - the year concatenated with the week then
# the day of that week.
# As this changes every day, we cycle to a new cache once per day, with lookup
# across the week (and then the year).
key: ${{ runner.os }}-${{ steps.current-time-with-day.outputs.formattedTime }}
restore-keys: |
${{ runner.os }}-${{ steps.current-time.outputs.formattedTime }}
${{ runner.os }}-
# Cancel current runs if they're still running
# (saves processing on fast pushes)
- name: Cancel Previous Runs
@ -58,10 +68,14 @@ jobs:
pip install pyyaml mako virtualenv
sudo apt-get install python-dev
- name: Check out repository code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: True
fetch-depth: 0
- name: Get the upstream code
run: |
cd ${{ github.workspace }}
git remote add upstream https://github.com/grpc/grpc
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 upstream master
# Run the things!
- name: clang-tidy fixes
run: ${{ github.workspace }}/tools/distrib/clang_tidy_code.sh --fix --only-changed || true

@ -56,7 +56,7 @@ if args.only_changed:
orig_files = set(args.files)
actual_files = []
output = subprocess.check_output(
['git', 'diff', 'origin/master', 'HEAD', '--name-only'])
['git', 'diff', 'upstream/master', 'HEAD', '--name-only'])
for line in output.decode('ascii').splitlines(False):
if line in orig_files:
print(("check: %s" % line))

Loading…
Cancel
Save