Skip to content

Commit

Permalink
Pass total errors
Browse files Browse the repository at this point in the history
Instead of passing the raw output, pass only the total amount of errors
found in the sanity test
  • Loading branch information
tonyskapunk authored and fredericlepied committed Nov 23, 2023
1 parent 1f4b271 commit 4b49276
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/sanity-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,24 @@ jobs:
# Always succeeding sanity test until all errors are fixed
- name: Run sanity test
run: |
{
echo 'sanity<<EOF'
ansible-test sanity \
sanity=$(\
ansible-test \
sanity \
--verbose \
--docker \
--color \
--coverage \
--failure-ok
echo EOF
} >> ${GITHUB_OUTPUT}
--failure-ok \
2>&1 \
)
echo "${sanity}"
echo errors=$(grep -c "ERROR: [rp]" <<< "${sanity}") >> $GITHUB_OUTPUT
working-directory: ${{ matrix.ansible }}/ansible_collections/redhatci/ocp
id: sanity_test

- name: Error summary
run: |
echo "## Error summary" >> ${GITHUB_STEP_SUMMARY}
echo "" >> ${GITHUB_STEP_SUMMARY}
echo "Total Errors: $(grep -c "ERROR: [rp]" <<< "${{ steps.sanity_test.outputs.sanity }}") >> ${GITHUB_STEP_SUMMARY}
grep "ERROR: F" <<< "${{ steps.sanity_test.outputs.sanity }}" >> ${GITHUB_STEP_SUMMARY}
echo "Total Errors: ${{ steps.sanity_test.outputs.errors }}" >> ${GITHUB_STEP_SUMMARY}
echo "" >> ${GITHUB_STEP_SUMMARY}

0 comments on commit 4b49276

Please sign in to comment.