daml/ci/clean-up.yml
Gary Verhaegen 151e12b81a
bump copyright (#16002)
This is the result of:

- Updating `./COPY` to say `2023`.
- Running `./dev-env/bin/dade-copyright-headers update .`
2023-01-04 18:21:15 +01:00

58 lines
1.4 KiB
YAML

# Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
steps:
- bash: |
set -euo pipefail
eval "$(dev-env/bin/dade-assist)"
exec 1> >(while IFS= read -r line; do echo "$(date -uIs) [out]: $line"; done)
exec 2> >(while IFS= read -r line; do echo "$(date -uIs) [err]: $line"; done >&2)
## START temp debug
UNAME=$(uname)
case "$UNAME" in
Darwin)
MPS="/var/tmp/_bazel_vsts /Users/vsts/.bazel-cache"
CMD="hdiutil info"
;;
Linux)
MPS="/home/vsts/.cache/bazel /home/vsts/.bazel-cache"
CMD="mount"
;;
*)
echo "Unexpected uname: $UNAME"
MPS=
;;
esac
for path in $MPS; do
if ! ($CMD | grep -F "$path"); then
echo "$path is not a mount point, forcing cache reset"
$HOME/reset_caches.sh
echo "Done."
fi
done
## END temp debug
df -h .
if [ $(df -m . | sed 1d | awk '{print $4}') -lt 80000 ]; then
echo "Disk full, cleaning up..."
$HOME/reset_caches.sh
echo "Done."
df -h .
fi
## More temp debugging
for path in $MPS; do
if ! ($CMD | grep -F "$path"); then
echo "$path is not a mount point, forcing cache reset"
$HOME/reset_caches.sh
echo "Done."
fi
done
## End more debugging
displayName: clean-up disk cache