mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
Merge pull request #2461 from zed-industries/ci-target-dir-size
During CI, clear the target directory if it gets larger than a maximum size
This commit is contained in:
commit
bebb5456c7
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -62,6 +62,9 @@ jobs:
|
|||||||
clean: false
|
clean: false
|
||||||
submodules: 'recursive'
|
submodules: 'recursive'
|
||||||
|
|
||||||
|
- name: Limit target directory size
|
||||||
|
run: script/clear-target-dir-if-larger-than 70
|
||||||
|
|
||||||
- name: Run check
|
- name: Run check
|
||||||
run: cargo check --workspace
|
run: cargo check --workspace
|
||||||
|
|
||||||
@ -110,6 +113,9 @@ jobs:
|
|||||||
clean: false
|
clean: false
|
||||||
submodules: 'recursive'
|
submodules: 'recursive'
|
||||||
|
|
||||||
|
- name: Limit target directory size
|
||||||
|
run: script/clear-target-dir-if-larger-than 70
|
||||||
|
|
||||||
- name: Determine version and release channel
|
- name: Determine version and release channel
|
||||||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||||
run: |
|
run: |
|
||||||
|
20
script/clear-target-dir-if-larger-than
Executable file
20
script/clear-target-dir-if-larger-than
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
if [[ $# < 1 ]]; then
|
||||||
|
echo "usage: $0 <MAX_SIZE_IN_GB>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
max_size_gb=$1
|
||||||
|
|
||||||
|
current_size=$(du -s target | cut -f1)
|
||||||
|
current_size_gb=$(expr ${current_size} / 1024 / 1024)
|
||||||
|
|
||||||
|
echo "target directory size: ${current_size_gb}gb. max size: ${max_size_gb}gb"
|
||||||
|
|
||||||
|
if [[ ${current_size_gb} -gt ${max_size_gb} ]]; then
|
||||||
|
echo "clearing target directory"
|
||||||
|
rm -rf target
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user