Skip to content

Commit

Permalink
Remove unused GHCup caches in CI
Browse files Browse the repository at this point in the history
Helps us to avoid running out of disk space during a CI job.
  • Loading branch information
fendor committed Aug 20, 2024
1 parent 6f6f75b commit 2f77412
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/actions/setup-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,17 @@ runs:
- name: "Remove freeze file"
run: rm -f cabal.project.freeze
shell: bash

# Make sure the clear all ghcup caches.
# At some point, we were running out of disk space, see issue
# https://github.com/haskell/haskell-language-server/issues/4386
#
# Using "printf" debugging (`du -sh *` and `df -h /`), we figured out that
# `ghcup` caches are taking up a sizable portion of the disk space.
# Thus, we remove anything we don't need, especially caches and temporary files.
# For got measure, we also make sure no other tooling versions are
# installed besides the ones we explicitly want.
- name: "Remove ghcup caches"
if: runner.os == 'Linux'
run: ghcup gc --ghc-old --share-dir --hls-no-ghc --cache --tmpdirs --unset
shell: bash
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ jobs:
test: false

steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/setup-build
with:
ghc: ${{ matrix.ghc }}
Expand Down

0 comments on commit 2f77412

Please sign in to comment.