-
Notifications
You must be signed in to change notification settings - Fork 57
61 lines (52 loc) · 1.57 KB
/
ans-unit-test-inventory.yaml
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
# https://github.com/ansible-collections/collection_template/blob/main/.github/workflows/ansible-test.yml
env:
NAMESPACE: checkmk
COLLECTION_NAME: general
MODULE_NAME: checkmk
TESTPATH: tests/unit/plugins/inventory/test_checkmk.py
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
name: Ansible Unit Test for Inventory Module
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
pull_request:
branches:
- main
- devel
paths:
- 'plugins/inventory/checkmk.py'
push:
paths:
- 'plugins/inventory/checkmk.py'
jobs:
units:
runs-on: ubuntu-22.04
name: Units (Ⓐ${{ matrix.ansible }})
strategy:
fail-fast: true # false?
matrix:
ansible:
- stable-2.15
- stable-2.16
- stable-2.17
- devel
python:
- '3.10'
- '3.11'
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
- name: Set up Python
uses: actions/setup-python@v5
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 unit test
run: ansible-test units ${{env.TESTPATH}} -v --color --python ${{ matrix.python }} --docker default
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}