Skip to content

Commit

Permalink
ci: Free up disk space asynchronously
Browse files Browse the repository at this point in the history
Free-ing up disk space can take up to 8 minutes so let's make sure
we do it asynchronously since we don't need the free space immediately.
  • Loading branch information
DaanDeMeyer committed Mar 13, 2024
1 parent 69d7a8f commit 84524c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ jobs:
- uses: actions/checkout@v3
- uses: ./

# Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space
# immediately, we remove the files in the background. However, we first move them to a different location so that
# nothing tries to use anything in these directories anymore while we're busy deleting them.
- name: Free disk space
run: |
sudo rm -rf /usr/local
sudo rm -rf /opt/hostedtoolcache
sudo mv /usr/local /usr/local.trash
sudo mv /opt/hostedtoolcache /opt/hostedtoolcache.trash
sudo systemd-run rm -rf /usr/local.trash /opt/hostedtoolcache.trash
- name: Install
run: |
Expand Down

0 comments on commit 84524c8

Please sign in to comment.