Skip to content

Commit

Permalink
Add sanity check on PRs
Browse files Browse the repository at this point in the history
Using sanity checks as CI testing is a good practice for community
package collections[1].
Add initially without stopping CI to find the errors that need to be
fixed an once they are cleaned, enable them.

[1] https://docs.ansible.com/ansible/latest/community/collection_contributors/collection_requirements.html#ci-testing
  • Loading branch information
tonyskapunk committed Nov 1, 2023
1 parent 592664c commit d5f4f2d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/sanity-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Ansible Galaxy Publish
on:
pull_request:

jobs:
sanity:
name: Sanity Check
strategy:
matrix:
ansible:
- stable-2.9
- stable-2.15
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3
with:
path: ansible_collection/${{ github.repository }}

- 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: ansible-test sanity -v --docker --color --coverage || true
working-directory: ansible_collection/${{ github.repository }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tar.gz

0 comments on commit d5f4f2d

Please sign in to comment.