-
Notifications
You must be signed in to change notification settings - Fork 21
64 lines (59 loc) · 1.78 KB
/
machine_agent_ci.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
name: "appdynamics.agents.machine"
on:
push:
paths:
- 'roles/machine/**'
- 'molecule/machine/**'
- 'molecule/base-docker.yml'
- '.github/workflows/machine_agent_ci.yml'
- 'roles/common/**'
pull_request:
paths:
- 'roles/machine/**'
- 'molecule/machine/**'
- 'molecule/base-docker.yml'
- '.github/workflows/machine_agent_ci.yml'
- 'roles/common/**'
jobs:
molecule:
runs-on: ubuntu-latest
env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1
strategy:
fail-fast: true
max-parallel: 4
matrix:
distro:
- centos7
- debian10
collection_role:
- machine
ansible_ver:
- "==2.9.*"
- "==2.10.*"
- ">=2.10" # latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install test dependencies.
run: pip3 install "ansible${{ matrix.ansible_ver }}" molecule-docker docker yamllint ansible-lint flake8 lxml
- name: Build the collection
run: |
collection_file=$( basename $(ansible-galaxy collection build -f | awk -F" " '{print $NF}'))
echo "COLLECTION_FILE=$collection_file" >> $GITHUB_ENV
- name: Install the collection
run: ansible-galaxy collection install ${{ env.COLLECTION_FILE }}
- name: Run role tests
run: >-
molecule --version &&
ansible --version &&
molecule --base-config molecule/base-docker.yml --debug test -s ${{ matrix.collection_role }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
MOLECULE_DISTRO: ${{ matrix.distro }}