-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move github actions dsl checks to a script (#1042)
* Move github actions dsl checks to a script * Added a check for null values --------- Signed-off-by: Jose Luis Rivero <[email protected]>
- Loading branch information
Showing
2 changed files
with
36 additions
and
20 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 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,34 @@ | ||
#!/bin/bash -e | ||
# | ||
if [[ -z $(ls -- *.xml) ]]; then | ||
echo "No .xml file founds. Generate them using:" | ||
echo "https://github.com/gazebo-tooling/release-tools/blob/master/jenkins-scripts/README.md#L11" | ||
fi | ||
|
||
not_null=$(grep 'null' -- *.xml || true) | ||
if [[ -n ${not_null} ]]; then | ||
echo "Found a null value in a configuration file:" | ||
echo "${not_null}" | ||
echo "Probably a problem in the code" | ||
exit 1 | ||
fi | ||
|
||
main=$(grep '<branch>main</branch>' -- *-abichecker-*.xml || true) | ||
if [[ -n ${main} ]]; then | ||
echo "Found a main branch in an abichecker job:" | ||
echo "${main}" | ||
echo "Main branches are not target of abichecking. Fix the code." | ||
exit 1 | ||
fi | ||
|
||
# Filter out the previous auto jobs | ||
filtered_dir=$(mktemp -d) | ||
cp -- *-abichecker-*.xml "${filtered_dir}" | ||
rm -f "${filtered_dir}"/*-ubuntu_auto*.xml | ||
repeated=$(grep '\<branch>' "${filtered_dir}"/*-abichecker-*.xml | awk '{ print $2 }' | sort | uniq -d) | ||
if [[ -n ${repeated} ]]; then | ||
echo "Found a duplicate in an abichecker branch:" | ||
echo "${repeated}" | ||
echo "please exclude one of the versions in the yaml file to reduce the server workload" | ||
exit 1 | ||
fi |