Skip to content

Commit

Permalink
Merge pull request #2499 from DaanDeMeyer/async-rm
Browse files Browse the repository at this point in the history
ci: Free up disk space asynchronously
  • Loading branch information
DaanDeMeyer authored Mar 14, 2024
2 parents 69d7a8f + 0d602ce commit 6264135
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 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 All @@ -144,7 +148,7 @@ jobs:
mkfs.btrfs btrfs.raw
sudo mkdir -p /mnt/mkosi
LOOP="$(sudo losetup --find --show --direct-io=on btrfs.raw)"
sudo mount "$LOOP" /mnt/mkosi --options compress=zstd,user_subvol_rm_allowed
sudo mount "$LOOP" /mnt/mkosi --options compress=zstd:1,user_subvol_rm_allowed,noatime,discard=async,space_cache=v2
sudo chown "$(id -u):$(id -g)" /mnt/mkosi
- name: Configure
Expand Down

0 comments on commit 6264135

Please sign in to comment.