Skip to content

Commit

Permalink
Merge pull request conda-forge#1754 from jakirkham/gha_free_disk_space
Browse files Browse the repository at this point in the history
Add option to cleanup GHA images
  • Loading branch information
beckermr committed Jul 29, 2023
2 parents e938e8f + e7dcda6 commit 6dbdbac
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
29 changes: 28 additions & 1 deletion conda_smithy/templates/github-actions.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,33 @@ jobs:
{%- endif %}
{%- endfor %}
steps:
{%- if github_actions.free_disk_space %}

- name: Manage disk space
if: matrix.os == 'ubuntu'
run: |
sudo mkdir -p /opt/empty_dir || true
for d in \
/opt/ghc \
/opt/hostedtoolcache \
/usr/lib/jvm \
/usr/local/.ghcup \
/usr/local/lib/android \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift \
; do
sudo rsync --stats -a --delete /opt/empty_dir/ $d || true
done
sudo apt-get purge -y -f firefox \
google-chrome-stable \
microsoft-edge-stable
sudo apt-get autoremove -y >& /dev/null
sudo apt-get autoclean -y >& /dev/null
sudo docker image prune --all --force
df -h
{%- endif %}

- name: Checkout code
uses: actions/checkout@v3
{%- if clone_depth is not none %}
Expand Down Expand Up @@ -164,7 +191,7 @@ jobs:
{%- endif %}
setup_conda_rc .\ ".\{{ recipe_dir }}" .\.ci_support\%CONFIG%.yaml
if errorlevel 1 exit 1
{% if build_setup -%}
{%- if build_setup %}
{{ build_setup.replace("\n", "\n ").rstrip() }}
{%- endif %}
Expand Down
23 changes: 23 additions & 0 deletions news/gha_free_disk_space.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* Add option to cleanup GHA images - #1754

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>

0 comments on commit 6dbdbac

Please sign in to comment.