From ff175712c8edaf213a7c084fbc74721c4f380036 Mon Sep 17 00:00:00 2001 From: Orion Hodson Date: Fri, 10 Mar 2023 18:07:32 +0000 Subject: [PATCH] Add disk usage info to test plan Intended to help to identify space issues on runners. --- .github/workflows/test.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2783c1278b2..c11e8b22369 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,12 +24,23 @@ jobs: path: ~/bazel-disk-cache key: ${{ runner.os }}-${{ runner.arch }}-bazel-disk-cache - run: mkdir -p ~/bazel-disk-cache - - name: install dependencies + - name: Install dependencies if: ${{ runner.os == 'Linux' }} run: | export DEBIAN_FRONTEND=noninteractive sudo apt-get install -y build-essential git clang libc++-dev - - name: bazel tests + - name: Bazel tests run: | bazel test --disk_cache=~/bazel-disk-cache --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev --verbose_failures --show_timestamps --keep_going --test_output=errors //... + - name: Report disk usage + if: success() || failure() + run: | + BAZEL_OUTPUT_BASE=$(bazel info --ui_event_filters=-WARNING output_base) + BAZEL_REPOSITORY_CACHE=$(bazel info --ui_event_filters=-WARNING repository_cache) + echo "Bazel cache usage statistics" + du -hs -t 1 ~/bazel-disk-cache/* $BAZEL_REPOSITORY_CACHE + echo "Bazel output usage statistics" + du -hs -t 1 $BAZEL_OUTPUT_BASE + echo "Workspace usage statistics" + du -hs -t 1 $GITHUB_WORKSPACE