Skip to content

Commit

Permalink
#1: introduce ci problem matcher for shell output
Browse files Browse the repository at this point in the history
  • Loading branch information
tlamonthezie committed Sep 18, 2024
1 parent 4c18d89 commit 4ff524a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-repositories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Listing DARMA repositories
- name: Check repositories
run: bash ./ci/check_repositories.sh


31 changes: 31 additions & 0 deletions .github/workflows/matchers/shell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"problemMatcher": [
{
"owner": "shell-error",
"severity": "error",
"pattern": [
{
"regexp": "^[error]:\\s(.+)$"
}
]
},
{
"owner": "shell-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^[warning]:\\s(.+)$"
}
]
},
{
"owner": "shell-notice",
"severity": "notice",
"pattern": [
{
"regexp": "^[notice]:\\s(.+)$"
}
]
}
]
}
10 changes: 7 additions & 3 deletions ci/check_repositories.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ do

if [[ " ${CHECKS_REPOS[*]} " =~ [[:space:]]${e}[[:space:]] ]]; then
echo "$ORG/$e > Ignoring (checks repository)";
echo "----------------------------------";
echo "--------------------------------------------------";
elif [[ " ${EXCLUDE_REPOS[*]} " =~ [[:space:]]${e}[[:space:]] ]]; then
echo "$ORG/$e > Ignoring (excluded)";
echo "----------------------------------";
echo "--------------------------------------------------";
else
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[@]}"
Expand All @@ -52,7 +53,10 @@ do
echo "[ok] workflow file '$w.yml' OK"
fi
done
echo "----------------------------------";
TSEND=$(date +%s)
TSDURATION=$(( $TSEND - $TSSTART ))
echo "$WORKING_DIR/$e has been processed in $TSDURATION seconds."
echo "--------------------------------------------------";
fi
done

0 comments on commit 4ff524a

Please sign in to comment.