Skip to content

Commit

Permalink
moving the script to front for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
edulix committed Nov 22, 2021
1 parent 4bf8d3b commit 3ad036d
Showing 1 changed file with 63 additions and 63 deletions.
126 changes: 63 additions & 63 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,69 @@ inputs:
runs:
using: "composite"
steps:
- name: Fail checks
id: fail-checks
shell: bash
env:
FAIL_ON: ${{ inputs.fail-on }}
run: |
[ "${FAIL_ON}" = "dont-fail" ] && \
{ echo "do not need to fail on unresolved issues so don't perform this step"; exit 0; };
echo "-----------------------------------------------------------------"
echo " ORT fail checks step"
echo "-----------------------------------------------------------------"
echo " Inputs: "
echo " FAIL_ON : '${FAIL_ON}' "
echo "-----------------------------------------------------------------"
[ "${FAIL_ON}" = "errors" ] && { \
echo " Checking unresolved errors"; \
echo "-----------------------------------------------------------------"; \
grep "Rule Violation Summary (0 errors" $A/ort/scan-report.html >/dev/null; \
export FAILED_EXEC=$?; \
if [ $FAILED_EXEC -eq 0 ]; \
then \
echo "0 unresolved errors"; \
else; \
echo "FAIL: report has unresolved errors"; \
exit 1; \
fi; \
} || echo "Do not fail on report unresolved errors";
echo "-----------------------------------------------------------------";
[ "${FAIL_ON}" = "warnings" ] && { \
echo " Checking unresolved errors/warnings"; \
echo "-----------------------------------------------------------------"; \
grep "Rule Violation Summary (0 errors, 0 warnings" $A/ort/scan-report.html >/dev/null; \
export FAILED_EXEC=$?; \
if [ $FAILED_EXEC -eq 0 ]; \
then \
echo "0 unresolved errors/warnings"; \
else; \
echo "FAIL: report has unresolved errors/warnings"; \
exit 1; \
fi; \
} || echo "Do not fail on report unresolved errors/warnings";
echo "-----------------------------------------------------------------";
[ "${FAIL_ON}" = "hints" ] && { \
echo " Checking unresolved errors/warnings/hints"; \
echo "-----------------------------------------------------------------"; \
grep "Rule Violation Summary (0 errors, 0 warnings, 0 hints to resolve)" $A/ort/scan-report.html >/dev/null; \
export FAILED_EXEC=$?; \
if [ $FAILED_EXEC -eq 0 ]; \
then \
echo "0 unresolved errors/warnings/hints"; \
else; \
echo "FAIL: report has unresolved errors/warnings/hints"; \
exit 1; \
fi; \
} || echo "Do not fail on report unresolved errors/warnings/hints";
echo "-----------------------------------------------------------------";

- name: Create output results directory and ORT_DATA_DIR=/project/.ort/
id: results-dir
shell: bash
Expand Down Expand Up @@ -260,66 +323,3 @@ runs:
echo "-----------------------------------------------------------------"
ls -lah ${{ github.workspace }}/ort/
echo "-----------------------------------------------------------------"
- name: Fail checks
id: fail-checks
shell: bash
env:
FAIL_ON: ${{ inputs.fail-on }}
run: |
[ "${FAIL_ON}" = "dont-fail" ] && \
{ echo "do not need to fail on unresolved issues so don't perform this step"; exit 0; };
echo "-----------------------------------------------------------------"
echo " ORT fail checks step"
echo "-----------------------------------------------------------------"
echo " Inputs: "
echo " FAIL_ON : '${FAIL_ON}' "
echo "-----------------------------------------------------------------"
[ "${FAIL_ON}" = "errors" ] && { \
echo " Checking unresolved errors"; \
echo "-----------------------------------------------------------------"; \
grep "Rule Violation Summary (0 errors" $A/ort/scan-report.html >/dev/null; \
export FAILED_EXEC=$?; \
if [ $FAILED_EXEC -eq 0 ]; \
then \
echo "0 unresolved errors"; \
else; \
echo "FAIL: report has unresolved errors"; \
exit 1; \
fi; \
} || echo "Do not fail on report unresolved errors";
echo "-----------------------------------------------------------------";
[ "${FAIL_ON}" = "warnings" ] && { \
echo " Checking unresolved errors/warnings"; \
echo "-----------------------------------------------------------------"; \
grep "Rule Violation Summary (0 errors, 0 warnings" $A/ort/scan-report.html >/dev/null; \
export FAILED_EXEC=$?; \
if [ $FAILED_EXEC -eq 0 ]; \
then \
echo "0 unresolved errors/warnings"; \
else; \
echo "FAIL: report has unresolved errors/warnings"; \
exit 1; \
fi; \
} || echo "Do not fail on report unresolved errors/warnings";
echo "-----------------------------------------------------------------";
[ "${FAIL_ON}" = "hints" ] && { \
echo " Checking unresolved errors/warnings/hints"; \
echo "-----------------------------------------------------------------"; \
grep "Rule Violation Summary (0 errors, 0 warnings, 0 hints to resolve)" $A/ort/scan-report.html >/dev/null; \
export FAILED_EXEC=$?; \
if [ $FAILED_EXEC -eq 0 ]; \
then \
echo "0 unresolved errors/warnings/hints"; \
else; \
echo "FAIL: report has unresolved errors/warnings/hints"; \
exit 1; \
fi; \
} || echo "Do not fail on report unresolved errors/warnings/hints";
echo "-----------------------------------------------------------------";

0 comments on commit 3ad036d

Please sign in to comment.