Skip to content

Commit 2f77412

Browse files
committed
Remove unused GHCup caches in CI
Helps us to avoid running out of disk space during a CI job.
1 parent 6f6f75b commit 2f77412

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Diff for: .github/actions/setup-build/action.yml

+14
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,17 @@ runs:
116116
- name: "Remove freeze file"
117117
run: rm -f cabal.project.freeze
118118
shell: bash
119+
120+
# Make sure the clear all ghcup caches.
121+
# At some point, we were running out of disk space, see issue
122+
# https://github.com/haskell/haskell-language-server/issues/4386
123+
#
124+
# Using "printf" debugging (`du -sh *` and `df -h /`), we figured out that
125+
# `ghcup` caches are taking up a sizable portion of the disk space.
126+
# Thus, we remove anything we don't need, especially caches and temporary files.
127+
# For got measure, we also make sure no other tooling versions are
128+
# installed besides the ones we explicitly want.
129+
- name: "Remove ghcup caches"
130+
if: runner.os == 'Linux'
131+
run: ghcup gc --ghc-old --share-dir --hls-no-ghc --cache --tmpdirs --unset
132+
shell: bash

Diff for: .github/workflows/test.yml

-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ jobs:
9090
test: false
9191

9292
steps:
93-
- uses: actions/checkout@v3
94-
9593
- uses: ./.github/actions/setup-build
9694
with:
9795
ghc: ${{ matrix.ghc }}

0 commit comments

Comments
 (0)