Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .github/workflows/prestocpp-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
needs: changes
container:
image: prestodb/presto-native-dependency:0.293-20250522140509-484b00e
volumes:
- /usr:/host_usr
- /opt:/host_opt
concurrency:
group: ${{ github.workflow }}-prestocpp-linux-build-${{ github.event.pull_request.number }}
cancel-in-progress: true
Expand Down Expand Up @@ -58,11 +61,22 @@ jobs:
ninja -C _build/debug -j 4

steps:
# We cannot use the github action to free disk space from the runner
# because we are in the container and not on the runner anymore.
- name: Free Disk Space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: true
swap-storage: false
run: |
# Re-used from free-disk-space github action.
getAvailableSpace() { echo $(df -a $1 | awk 'NR > 1 {avail+=$4} END {print avail}'); }
# Show before
echo "Original available disk space: " $(getAvailableSpace)
Comment on lines +69 to +71
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): The getAvailableSpace function does not specify a path argument, which may lead to ambiguous disk space reporting.

Calling getAvailableSpace without a path may report disk space for the root filesystem, which could be inaccurate if other mount points are affected. Specify the intended path when invoking the function.

Suggested implementation:

          # Show before
          echo "Original available disk space: " $(getAvailableSpace /host_usr)

          # Show after
          echo "New available disk space: " $(getAvailableSpace /host_usr)

# Remove DotNet.
rm -rf /host_usr/share/dotnet || true
# Remove android
rm -rf /host_usr/local/lib/android || true
# Remove CodeQL
rm -rf /host_opt/hostedtoolcache/CodeQL || true
# Show after
echo "New available disk space: " $(getAvailableSpace)

- uses: actions/checkout@v4
if: needs.changes.outputs.codechange == 'true'
Expand Down
Loading