Move Chipyard CI to Github Actions
- As similar as possible to the circle ci code. - The `.github/README.md` file has a fair amount of documentation for this. - Creates a worfklow file - re-uses most of the circleci/scipts unchanged - defines a number of *Composite Actions* which are like YML subroutines - Removes the circle-ci code - Points the CI badge in the top level README to use the GA test result
This commit is contained in:
29
.github/scripts/clean-old-files.sh
vendored
Executable file
29
.github/scripts/clean-old-files.sh
vendored
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
# clean directories that are older than 14 days
|
||||
# argument is used as the directory to look in
|
||||
|
||||
age () {
|
||||
local AGE_SEC
|
||||
local CUR_SEC
|
||||
local DIFF_SEC
|
||||
local SEC_PER_DAY
|
||||
|
||||
SEC_PER_DAY=86400
|
||||
|
||||
CUR_SEC=$(date +%s)
|
||||
AGE_SEC=$(stat -c %Y -- "$1")
|
||||
DIFF_SEC=$(expr $CUR_SEC - $AGE_SEC)
|
||||
|
||||
echo $(expr $DIFF_SEC / $SEC_PER_DAY)
|
||||
}
|
||||
|
||||
for d in $1/*/ ; do
|
||||
DIR_AGE="$(age $d)"
|
||||
if [ $DIR_AGE -ge 14 ]; then
|
||||
echo "Deleting $d since is it $DIR_AGE old"
|
||||
rm -rf $d
|
||||
else
|
||||
echo "Keep $d since it is $DIR_AGE old"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user