forked from ansible-collections/community.grafana
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (90 loc) · 3.63 KB
/
ansible-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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