Skip to content

Commit

Permalink
Merge pull request #35 from easimon/fix/find-with-sudo
Browse files Browse the repository at this point in the history
Fix/find with sudo
  • Loading branch information
easimon authored Nov 28, 2023
2 parents 89c6c4b + fe0431d commit bb67daa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,22 @@ env:
REPORT_DIR: /tmp/build-report

jobs:
test-action:
name: Test action
test-docker-tmp:
name: Test removing root-owned folder
runs-on: ubuntu-latest
steps:
- name: Check out Maximize Build Space action
uses: actions/checkout@v4
with:
path: ./.github/actions/maximize-test

- name: Maximize build space
uses: ./.github/actions/maximize-test
with:
build-mount-path: /var/lib/docker/tmp

determine-free-space:
name: Determine free space with different settings
runs-on: ${{ matrix.os }}

strategy:
Expand Down Expand Up @@ -117,7 +131,7 @@ jobs:
collect-reports:
name: Collect reports
runs-on: ubuntu-latest
needs: test-action
needs: determine-free-space
env:
REPORT_FILE: space-free-report.md

Expand Down
14 changes: 7 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ runs:
shell: bash
run: |
echo "Memory and swap:"
free
sudo free
echo
swapon --show
sudo swapon --show
echo
echo "Available storage:"
df -h
sudo df -h
echo
- name: Maximize build disk space
Expand Down Expand Up @@ -113,7 +113,7 @@ runs:
# ensure mount path exists before the action
sudo mkdir -p "${BUILD_MOUNT_PATH}"
find "${BUILD_MOUNT_PATH}" -maxdepth 0 ! -empty -exec echo 'WARNING: directory [{}] is not empty, data loss might occur. Content:' \; -exec ls -al "{}" \;
sudo find "${BUILD_MOUNT_PATH}" -maxdepth 0 ! -empty -exec echo 'WARNING: directory [{}] is not empty, data loss might occur. Content:' \; -exec ls -al "{}" \;
echo "Removing unwanted software... "
if [[ ${{ inputs.remove-dotnet }} == 'true' ]]; then
Expand Down Expand Up @@ -189,10 +189,10 @@ runs:
shell: bash
run: |
echo "Memory and swap:"
free
sudo free
echo
swapon --show
sudo swapon --show
echo
echo "Available storage:"
df -h
sudo df -h

0 comments on commit bb67daa

Please sign in to comment.