110 lines
3.6 KiB
YAML
110 lines
3.6 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
jobs:
|
|
sanity:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python_version: ["3.8"]
|
|
ansible_version: ["stable-2.10", "stable-2.11", "stable-2.12", "devel"]
|
|
steps:
|
|
|
|
- name: Check out code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
path: ansible_collections/community/grafana
|
|
|
|
- name: Set up Python ${{ matrix.python_version }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python_version }}
|
|
|
|
- name: Install ansible
|
|
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible_version }}.tar.gz --disable-pip-version-check
|
|
|
|
- name: Run sanity tests
|
|
run: ansible-test sanity --docker -v --color --coverage
|
|
working-directory: ./ansible_collections/community/grafana
|
|
|
|
- name: Generate coverage report
|
|
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
|
|
working-directory: ./ansible_collections/community/grafana
|
|
|
|
- uses: codecov/codecov-action@v2
|
|
with:
|
|
fail_ci_if_error: false
|
|
flags: sanity
|
|
|
|
units:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python_version: ["3.8"]
|
|
ansible_version: ["stable-2.9", "stable-2.10", "stable-2.11", "stable-2.12", "devel"]
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
path: ansible_collections/community/grafana
|
|
|
|
- name: Set up Python ${{ matrix.python_version }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python_version }}
|
|
|
|
- name: Install ansible
|
|
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible_version }}.tar.gz --disable-pip-version-check
|
|
|
|
- name: Run unit tests
|
|
run: ansible-test units --docker -v --color --python ${{ matrix.python_version }} --coverage
|
|
working-directory: ./ansible_collections/community/grafana
|
|
|
|
- name: Generate coverage report.
|
|
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
|
|
working-directory: ./ansible_collections/community/grafana
|
|
|
|
- uses: codecov/codecov-action@v2
|
|
with:
|
|
fail_ci_if_error: false
|
|
flags: units
|
|
|
|
integration:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
grafana_version: ["8.1.8", "8.2.7", "8.3.3"]
|
|
ansible_version: ["stable-2.9", "stable-2.10", "stable-2.11", "stable-2.12", "devel"]
|
|
python_version: ["3.8"]
|
|
container:
|
|
image: python:${{ matrix.python_version }}
|
|
services:
|
|
grafana:
|
|
image: grafana/grafana:${{ matrix.grafana_version }}
|
|
steps:
|
|
|
|
- name: Check out code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
path: ansible_collections/community/grafana
|
|
|
|
- name: Install ansible
|
|
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible_version }}.tar.gz --disable-pip-version-check
|
|
|
|
- name: Run integration tests on Python ${{ matrix.python_version }}
|
|
run: ansible-test integration -v --color --retry-on-error --requirements --python ${{ matrix.python_version }} --continue-on-error --diff --coverage
|
|
working-directory: ./ansible_collections/community/grafana
|
|
|
|
- name: Generate coverage report
|
|
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
|
|
working-directory: ./ansible_collections/community/grafana
|
|
|
|
- uses: codecov/codecov-action@v2
|
|
with:
|
|
fail_ci_if_error: false
|
|
flags: integration
|