Skip to content

Allow selection of file deletion modes #19

Allow selection of file deletion modes

Allow selection of file deletion modes #19

Workflow file for this run

name: CI - Test free-disk-space action
on:
# push:
# branches: [ main, develop ]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ main, develop ]
# workflow_dispatch:
jobs:
test-action:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Show disk usage before
run: |
echo "Before freeing disk space:"
df -h
echo "\nInodes before:"
df -ih
- name: Run free-disk-space action (local)
uses: ./
with:
# Keep tool-cache disabled by default to avoid removing pre-cached tools
tool-cache: "true"
# All other options are true by default; explicitly setting a couple for clarity
mandb: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: Show disk usage after
run: |
echo "After freeing disk space:"
df -h
echo "\nInodes after:"
df -ih
- name: Basic sanity checks
shell: bash
run: |
# Ensure action executed and common targets were affected (best-effort checks)
# Swapfile should be removed when swap-storage=true (best-effort; tolerate absence)
if [ -e /swapfile ]; then
echo "Warning: /swapfile still exists (runner image may not have swapfile)." >&2
else
echo "OK: /swapfile not present."
fi
# Ensure step didn't fail and disk output is available
which df >/dev/null 2>&1 || (echo "df not found" && exit 1)