Run Ansible tests #856
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Ansible tests | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
# Run the unit tests every 8 hours. | |
# This will help to identify faster if | |
# there is a CI failure related to a | |
# change in any dependency. | |
schedule: | |
- cron: '0 */8 * * *' | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- "3.10" | |
- "3.9" | |
defaults: | |
run: | |
working-directory: ansible_collections/ | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: ansible_collections/ansible/eda | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install ansible | |
run: python -m pip install ansible | |
- name: Run sanity tests | |
run: ansible-test sanity | |
working-directory: ansible_collections/ansible/eda | |
- name: Run unit tests | |
run: ansible-test units --venv | |
working-directory: ansible_collections/ansible/eda |