From e8bfc5bb69529bffe777eef921214fe90a37dd66 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Sun, 23 May 2021 23:41:02 +0100 Subject: [PATCH] ci: Prevent ~/.stack/pantry cache from being empty When building with an LTS version that has exactly the dependencies we need (X11-1.9.2), stack doesn't need to download the Hackage index. If GitHub Actions cache locking chooses this job as the one that writes the cache, then the "stack-pantry-Linux" cache entry stays empty, possibly forever. Force Hackage index update to prevent this from happening. Related: https://github.com/xmonad/xmonad-contrib/commit/d1a4820b55931055f8eccae5dc306d58dea21d93 --- .github/workflows/stack.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/stack.yml b/.github/workflows/stack.yml index 7958791..73b6498 100644 --- a/.github/workflows/stack.yml +++ b/.github/workflows/stack.yml @@ -66,6 +66,12 @@ jobs: stack-${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml') }}- stack-${{ runner.os }}-${{ matrix.resolver }}- + - name: Update hackage index + # always update index to prevent the shared ~/.stack/pantry cache from being empty + run: | + set -ex + stack update + - name: Build and test run: | set -ex