Skip to content

Add sanity check on PRs #9

Add sanity check on PRs

Add sanity check on PRs #9

Workflow file for this run

name: Ansible Sanity Check
on:
pull_request:
jobs:
sanity:
name: Sanity Check
strategy:
matrix:
ansible:
# 2.9 fails due to https://github.com/ansible/ansible/issues/68819
- stable-2.10
- stable-2.15
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ matrix.ansible }}/ansible_collections/redhatci/ocp
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install ansible-base ${{ matrix.ansible }}
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
# Always succeeding sanity test until all errors are fixed
- name: Run sanity test
run: |
{
echo 'sanity<<EOF'
ansible-test sanity \
--verbose \
--docker \
--color \
--coverage \
--failure-ok
echo EOF
} >> ${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 "" >> ${GITHUB_STEP_SUMMARY}