CI #310
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: CI | |
on: | |
# Run CI against all pushes (direct commits, also merged PRs), Pull Requests | |
push: | |
pull_request: | |
# Run CI once per day (at 06:00 UTC) | |
# This ensures that even if there haven't been commits that we are still testing against latest version of ansible-test for each ansible-base version | |
schedule: | |
- cron: '0 6 * * *' | |
env: | |
NAMESPACE: cisco | |
COLLECTION_NAME: cml | |
jobs: | |
### | |
# Sanity tests (REQUIRED) | |
# | |
# https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html | |
sanity: | |
name: Sanity (Ⓐ${{ matrix.ansible }}) | |
strategy: | |
matrix: | |
ansible: | |
# It's important that Sanity is tested against all stable-X.Y branches | |
# Testing against `devel` may fail as new tests are added. | |
- stable-2.15 | |
- stable-2.16 | |
- devel | |
runs-on: ubuntu-latest | |
steps: | |
# ansible-test requires the collection to be in a directory in the form | |
# .../ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}/ | |
- name: Check out code | |
uses: actions/checkout@v2 | |
with: | |
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}} | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
# it is just required to run that once as "ansible-test sanity" in the docker image | |
# will run on all python versions it supports. | |
python-version: '3.10' | |
# Install the head of the given branch (devel, stable-2.10) | |
- name: Install ansible-base (${{ matrix.ansible }}) | |
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check | |
# run ansible-test sanity inside of Docker. | |
# The docker container has all the pinned dependencies that are required | |
# and all python versions ansible supports. | |
- name: Run sanity tests | |
run: ansible-test sanity --docker -v --color | |
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}} |