Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get additional workflow information about diskspace #29705

Merged
4 changes: 4 additions & 0 deletions .github/actions/checkout-submodules-and-bootstrap/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ inputs:
runs:
using: "composite"
steps:
- name: Dump info
uses: ./.github/actions/dump-disk-info
with:
platform: ${{ inputs.platform }}
- name: Checkout submodules
uses: ./.github/actions/checkout-submodules
with:
Expand Down
16 changes: 16 additions & 0 deletions .github/actions/dump-disk-info/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Dump disk space info
description: Help debug running out of disk space on github CI
inputs:
platform:
description: "Platform name"
required: true
runs:
using: "composite"
tehampson marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Collect disk info
uses: pyTooling/Actions/with-post-step@v0.4.5
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
with:
main: |-
exec ./scripts/dump_diskspace_info.sh
post: |-
exec ./scripts/dump_diskspace_info.sh
41 changes: 41 additions & 0 deletions scripts/dump_diskspace_info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
#
# Copyright (c) 2022 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# This script is meant to run in github CI to dump information related to
# disk space usage. Currently there is a heisenbug related to running out
# of disk space. Dumping information below might help us get a better
# understanding of how disk space is used in github CI.

echo "Disk Space Usage:"
df -h

listOfDirectories=("third_party/" ".environment/" "out/")

pipCacheDir=$(python -m pip cache dir)
exitcode=$?

if [ $exitcode -eq 0 ]; then
listOfDirectories+=($pipCacheDir)
fi


echo "Storage Space Used By Key Directories:"
for directory in ${listOfDirectories[@]}; do
if [ -d "$directory" ]; then
du -d1 -h $directory
fi
done
Loading