-
Notifications
You must be signed in to change notification settings - Fork 57
83 lines (72 loc) · 2.38 KB
/
molecule-role-agent.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# https://github.com/ansible-collections/collection_template/blob/main/.github/workflows/ansible-test.yml
env:
NAMESPACE: checkmk
COLLECTION_NAME: general
name: Molecule Tests for Agent Role
on:
workflow_dispatch:
pull_request:
branches:
- main
- devel
paths:
- 'roles/agent/**'
push:
branches:
- main
- devel
paths:
- 'roles/agent/**'
jobs:
build:
runs-on: ubuntu-22.04
name: Checkmk ${{ matrix.checkmk }}
strategy:
fail-fast: false
matrix:
checkmk:
- '2.1.0'
- '2.2.0'
- '2.3.0'
steps:
- name: "Free Disk Space."
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
- name: "Add swap file to avoid memory shortage."
run: |
sudo fallocate -l 8G /swap
sudo chmod 600 /swap
sudo mkswap /swap
sudo swapon /swap
free -h
swapon --show
- 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 dependencies."
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
# The following works around a incompatibility between Python requests and Docker.
# https://github.com/ansible-collections/community.docker/issues/860
# Remove at a later point, when the updated community.docker is shipped.
ansible-galaxy collection install community.docker --force
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
- name: "Provide secrets file."
run: echo "${{ secrets.CHECKMK_DOWNLOAD_PW }}" > .dl-secret
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
env:
CHECKMK_DOWNLOAD_PW: ${{ secrets.CHECKMK_DOWNLOAD_PW }}
- name: "Run Molecule."
run: |
cd roles/agent/
molecule test -s ${{ matrix.checkmk }}
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}