Skip to content

Commit

Permalink
ci: free disk space (#1512)
Browse files Browse the repository at this point in the history
  • Loading branch information
4eUeP authored Jul 14, 2023
1 parent 5b3c2ea commit 884d909
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ jobs:
ld_image: "hstreamdb/logdevice:rqlite"
tag: "rqlite_${GITHUB_REF#refs/*/}"
steps:
- name: Free disk space
run: |
echo "Before..."
df -h
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
"/usr/local/share/boost" \
/usr/lib/jvm || true
echo "After..."
df -h
- run: |
echo "${{ matrix.tag }}"
- uses: actions/checkout@v3
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/publish_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ jobs:
ld_image: "hstreamdb/logdevice:rqlite"
tag: "rqlite"
steps:
# Ref:
# - https://github.com/actions/runner-images/issues/2840
# - https://stackoverflow.com/questions/75536771/github-runner-out-of-disk-space-after-building-docker-image
- name: Free disk space
run: |
echo "Before..."
df -h
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
"/usr/local/share/boost" \
/usr/lib/jvm || true
echo "After..."
df -h
- uses: actions/checkout@v3
with:
submodules: "recursive"
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ RUN set -eux; \
cabal-store-gc --add-project-root; \
mkdir /root/.ghc; \
cabal-store-gc --collect; \
rm -rf /root/.cabal/bin; \
rm -rf /root/.cabal/logs; \
rm -rf /root/.cabal/store/ghc-$(ghc --numeric-version)/hstream*; \
rm -rf /root/.cabal/store/roots;

# ------------------------------------------------------------------------------
Expand Down

0 comments on commit 884d909

Please sign in to comment.