generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 5
145 lines (122 loc) · 4.65 KB
/
ansible-test-plugins.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Plugins CI
on:
push:
paths:
- 'plugins/**'
- 'tests/**'
- '.github/workflows/ansible-test-plugins.yml'
pull_request:
paths:
- 'plugins/**'
- 'tests/**'
- '.github/workflows/ansible-test-plugins.yml'
schedule:
- cron: '0 6 * * *'
env:
clickhouse_version_file: "./ansible_collections/community/clickhouse/tests/integration/targets/setup_clickhouse/vars/main.yml"
clickhouse_test_info_file: "./ansible_collections/community/clickhouse/tests/integration/targets/clickhouse_info/tasks/initial.yml"
jobs:
sanity:
name: "Sanity (Python: ${{ matrix.python }}, Ansible: ${{ matrix.ansible }})"
runs-on: ubuntu-latest
strategy:
matrix:
ansible:
- stable-2.15
- stable-2.16
- stable-2.17
- devel
steps:
- name: Check out code
uses: actions/checkout@v2
with:
path: ansible_collections/community/clickhouse
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Run sanity tests
run: ansible-test sanity --docker -v --color
working-directory: ./ansible_collections/community/clickhouse
units:
runs-on: ubuntu-latest
name: Units (Ⓐ${{ matrix.ansible }})
strategy:
# As soon as the first unit test fails,
# cancel the others to free up the CI queue
fail-fast: true
matrix:
ansible:
- stable-2.15
- stable-2.16
- stable-2.17
- devel
steps:
- name: Check out code
uses: actions/checkout@v2
with:
path: ./ansible_collections/community/clickhouse
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Instal clickhouse-driver
run: pip install clickhouse-driver
# Run the unit tests
- name: Run unit test
run: ansible-test units -v --color --python 3.10 --docker --coverage
working-directory: ./ansible_collections/community/clickhouse
# ansible-test support producing code coverage date
- name: Generate coverage report
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
working-directory: ./ansible_collections/community/clickhouse
# See the reports at https://codecov.io/gh/GITHUBORG/REPONAME
- uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false
integration:
name: "Integration (Python: ${{ matrix.python }}, Ansible: ${{ matrix.ansible }}, ClickHouse: ${{ matrix.clickhouse }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ansible:
- stable-2.15
- stable-2.16
- stable-2.17
- devel
clickhouse:
- 21.8.15.7
- 22.8.9.24
- 23.8.9.54
python:
- "3.11"
steps:
- name: Check out code
uses: actions/checkout@v2
with:
path: ansible_collections/community/clickhouse
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Set Clickhouse version (${{ matrix.clickhouse }})
run: "sed -i 's/^clickhouse_version:.*/clickhouse_version: \"${{ matrix.clickhouse }}\"/g' ${{ env.clickhouse_version_file }}"
- name: Set Clickhouse version (${{ matrix.clickhouse }})
run: "sed -i 's/test_shard_localhost/default/g' ${{ env.clickhouse_test_info_file }}"
if: ${{ matrix.clickhouse == '23.8.9.54' }}
- name: Run integration tests
run: ansible-test integration --docker ubuntu2204 -v --color --retry-on-error --continue-on-error --python ${{ matrix.python }} --diff --coverage
working-directory: ./ansible_collections/community/clickhouse
- name: Generate coverage report.
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
working-directory: ./ansible_collections/community/clickhouse
- uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false