generated from DARMA-tasking/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1: implementing dynamic ci matrix strategy
- Loading branch information
1 parent
51b3b0c
commit b8baddc
Showing
4 changed files
with
93 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
CURRENT_DIR="$(dirname -- "$(realpath -- "$0")")" # Current directory | ||
PARENT_DIR="$(dirname "$CURRENT_DIR")" | ||
WORKING_DIR="$PARENT_DIR/output" | ||
ORG=DARMA-tasking | ||
|
||
# Clean | ||
rm -rf $WORKING_DIR | ||
mkdir -p $WORKING_DIR | ||
|
||
CHECKS_REPOS=( \ | ||
find-unsigned-commits \ | ||
check-commit-format \ | ||
find-trailing-whitespace \ | ||
check-pr-fixes-issue \ | ||
) | ||
|
||
N_ERRORS=0 | ||
TSSTART=$(date +%s) | ||
echo "$ORG/$e > Cloning repository..."; | ||
git clone https://github.com/$ORG/$e $WORKING_DIR/$e >/dev/null 2>&1 | ||
for w in "${EXPECTED_WORKFLOWS[@]}" | ||
do | ||
if [ ! -f "$WORKING_DIR/$e/.github/workflows/$w.yml" ]; then | ||
echo "[error] Missing workflow file '$w.yml' at $WORKING_DIR/$e/.github/workflows/$w.yml" | ||
$((N_ERRORS++)) | ||
else | ||
echo "[ok] workflow file '$w.yml' OK" | ||
fi | ||
done | ||
TSEND=$(date +%s) | ||
TSDURATION=$(( $TSEND - $TSSTART )) | ||
if [[ $N_REPO_ERRORS -gt 0 ]] | ||
then | ||
echo "$WORKING_DIR/$e has $N_REPO_ERRORS errors." | ||
else | ||
echo "[success] repository checks OK." | ||
fi | ||
echo "$WORKING_DIR/$e has been processed in $TSDURATION seconds." | ||
echo "--------------------------------------------------"; | ||
|
||
if [[ $N_ERRORS -gt 0 ]] | ||
then | ||
exit(1) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
CURRENT_DIR="$(dirname -- "$(realpath -- "$0")")" # Current directory | ||
PARENT_DIR="$(dirname "$CURRENT_DIR")" | ||
WORKING_DIR="$PARENT_DIR/output" | ||
ORG=DARMA-tasking | ||
|
||
EXCLUDE='[ | ||
"DARMA-tasking.github.io", | ||
"find-unsigned-commits", | ||
"check-commit-format", | ||
"find-trailing-whitespace", | ||
"check-pr-fixes-issue" | ||
]' | ||
JQ=$EXCLUDE' as $blacklist | .[] | select( . as $in | $blacklist | index($in) | not)' | ||
gh repo list DARMA-tasking --json name,defaultBranchRef --jq "$JQ" --jq 'sort_by(.name)' | jq |