From 1bf57a7810c4271e867e0621292a84937dc35011 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Fri, 15 Apr 2022 18:24:00 +0200 Subject: [PATCH] Add manual workflow for flushing CI cache --- .github/workflows/flush-cache.yml | 18 ++++++++++++++++++ CONTRIBUTING.md | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 .github/workflows/flush-cache.yml diff --git a/.github/workflows/flush-cache.yml b/.github/workflows/flush-cache.yml new file mode 100644 index 00000000000..4dd5e919321 --- /dev/null +++ b/.github/workflows/flush-cache.yml @@ -0,0 +1,18 @@ +# Based on https://github.com/actions/cache/issues/2#issuecomment-1098723830 +# This seems to be the only way to flush GitHub Actions cache without changing +# the cache key every time. +# It looks like this has to be run a couple of times in a row to work. +on: + workflow_dispatch: + pull_request: # temporary, remove before merging if this works +jobs: + flush-cache: + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v2 + with: + path: /tmp/flush + key: ${{ github.run_id }}-${{ github.run_attempt }} + # 10 GB is the max cache size. Anything over that will be evicted. + # Data is zstd-compressed, so we can't fallocate it. + - run: dd if=/dev/urandom of=/tmp/flush bs=1M count=10000 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b7d961e0ae3..27778607682 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,6 +75,9 @@ failures: If none of these let you reproduce, there might be some race condition or continuous integration breakage; please file a bug. +If all PRs are failing with a cache-related error, ask the maintainers to +manually trigger the `flush-cache` GitHub Actions Workflow a couple of times. + **Running tests locally.** To run tests locally with `v2-build`, you will need to know the name of the test suite you want. Cabal and cabal-install have