Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint job stopping early after first failure #55

Merged
merged 5 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
with:
mode: lint
report-level: all
fail-level: error
fail-level: warn
repository-list: ${{ needs.setup-ci-tools.outputs.repository-list }}
tool-list: ${{ needs.setup-ci-tools.outputs.tool-list }}
additional-planemo-options: --report_level all
Expand Down
11 changes: 7 additions & 4 deletions planemo_ci_actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,27 @@ fi
# - call `planemo lint` for each repo
# - check if each tool is in a repo (i.e. if `.shed.yml` is present)
if [ "$MODE" == "lint" ]; then
lint_fail=false
mapfile -t REPO_ARRAY < repository_list.txt
for DIR in "${REPO_ARRAY[@]}"; do
if [ "$WORKFLOWS" != "true" ]; then
planemo shed_lint --tools --ensure_metadata --urls --report_level "$REPORT_LEVEL" --fail_level "$FAIL_LEVEL" --recursive "$DIR" "${ADDITIONAL_PLANEMO_OPTIONS[@]}" | tee -a lint_report.txt
(planemo shed_lint --tools --ensure_metadata --urls --report_level "$REPORT_LEVEL" --fail_level "$FAIL_LEVEL" --recursive "$DIR" "${ADDITIONAL_PLANEMO_OPTIONS[@]}" | tee -a lint_report.txt) || lint_fail=true
else
planemo workflow_lint --report_level "$REPORT_LEVEL" --fail_level "$FAIL_LEVEL" "$DIR" "${ADDITIONAL_PLANEMO_OPTIONS[@]}" | tee -a lint_report.txt
(planemo workflow_lint --report_level "$REPORT_LEVEL" --fail_level "$FAIL_LEVEL" "$DIR" "${ADDITIONAL_PLANEMO_OPTIONS[@]}" | tee -a lint_report.txt) || lint_fail=true
fi
done

# Check if each changed tool is in the list of changed repositories
mapfile -t TOOL_ARRAY < tool_list.txt
for TOOL in "${TOOL_ARRAY[@]}"; do
# Check if any changed repo dir is a substring of $TOOL
if ! echo "$TOOL" | grep -qf repository_list.txt; then
echo "Tool $TOOL not in changed repositories list: .shed.yml file missing" >&2
exit 1
lint_fail=true
fi
done
if [ "$lint_fail" = "true" ]; then
exit 1
fi
fi

# test mode
Expand Down
Loading