96 lines
3.3 KiB
YAML
96 lines
3.3 KiB
YAML
---
|
|
name: repo-sanity
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
tox-linters:
|
|
name: Tox-Lint (py${{ matrix.python }})
|
|
strategy:
|
|
matrix:
|
|
python:
|
|
- 2.7 # required by Ansible see https://github.com/ansible-collections/overview/blob/main/collection_requirements.rst#python-compatibility
|
|
- 3.6 # required by Ansible see https://github.com/ansible-collections/overview/blob/main/collection_requirements.rst#python-compatibility
|
|
- 3.9
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
path: ansible_collections/community/zabbix
|
|
|
|
- name: Set up Python ${{ matrix.python }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
|
|
- name: Install dependencies
|
|
run: pip install flake8 tox
|
|
|
|
- name: Run lint test for py2
|
|
run: tox -elinters-py2 -vv
|
|
working-directory: ./ansible_collections/community/zabbix
|
|
if: matrix.python == '2.7'
|
|
|
|
- name: Run lint test for py3
|
|
run: tox -elinters-py3 -vv
|
|
working-directory: ./ansible_collections/community/zabbix
|
|
if: matrix.python != '2.7'
|
|
|
|
sanity:
|
|
name: Sanity (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})
|
|
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.10
|
|
- stable-2.11
|
|
- stable-2.12
|
|
- stable-2.13
|
|
- devel
|
|
python:
|
|
- 2.7 # required by Ansible see https://github.com/ansible-collections/overview/blob/main/collection_requirements.rst#python-compatibility
|
|
- 3.6 # required by Ansible see https://github.com/ansible-collections/overview/blob/main/collection_requirements.rst#python-compatibility
|
|
- 3.9
|
|
exclude:
|
|
- ansible: devel
|
|
python: 2.7
|
|
- ansible: devel
|
|
python: 3.6
|
|
- ansible: stable-2.12
|
|
python: 2.7
|
|
- ansible: stable-2.12
|
|
python: 3.6
|
|
- ansible: stable-2.13
|
|
python: 2.7
|
|
- ansible: stable-2.13
|
|
python: 3.6
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
# ansible-test requires the collection to be in a directory in the form
|
|
# .../ansible_collections/NAMESPACE/COLLECTION_NAME/
|
|
|
|
- name: Check out code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
path: ansible_collections/community/zabbix
|
|
|
|
- name: Set up Python ${{ matrix.ansible }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
|
|
# 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.
|
|
# Explicity specify the version of Python we want to test
|
|
- name: Run sanity tests
|
|
run: ansible-test sanity --docker -v --color --exclude molecule/ --python ${{ matrix.python }}
|
|
working-directory: ./ansible_collections/community/zabbix
|