Skip to content

Commit 44ac0ac

Browse files
committed
add workflow for pihole
1 parent 5377eea commit 44ac0ac

2 files changed

Lines changed: 207 additions & 1 deletion

File tree

.github/workflows/pihole.yml

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
---
2+
3+
name: pihole
4+
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
logLevel:
9+
description: 'Log level'
10+
required: true
11+
default: 'warning'
12+
type: choice
13+
options:
14+
- info
15+
- warning
16+
- debug
17+
push:
18+
branches:
19+
- 'main'
20+
- 'feature/**'
21+
- 'fix/**'
22+
- '!doc/**'
23+
paths:
24+
- "!Makefile"
25+
- "!README.md"
26+
- 'roles/pihole/**'
27+
- '.github/workflows/pihole.yml'
28+
- '.config/ansible-lint.yml'
29+
- '.yamllint'
30+
pull_request:
31+
branches:
32+
- 'main'
33+
- 'feature/**'
34+
- 'fix/**'
35+
- '!doc/**'
36+
paths:
37+
- "!Makefile"
38+
- "!README.md"
39+
- 'roles/pihole/**'
40+
- '.github/workflows/pihole.yml'
41+
- '.config/ansible-lint.yml'
42+
- '.yamllint'
43+
44+
env:
45+
COLLECTION_NAMESPACE: bodsch
46+
COLLECTION_NAME: dns
47+
PY_COLORS: '1'
48+
ANSIBLE_FORCE_COLOR: '1'
49+
50+
jobs:
51+
debian:
52+
name: "${{ matrix.image }} / ${{ matrix.scenario }} / ${{ matrix.ansible-version }} / ${{ matrix.python_version }}"
53+
runs-on: ubuntu-22.04
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
image:
58+
- debian:12
59+
ansible-version:
60+
- '9.5'
61+
python_version:
62+
- '3.12'
63+
scenario:
64+
- default
65+
collection_role:
66+
- pihole
67+
68+
steps:
69+
- name: check out the codebase.
70+
uses: actions/checkout@v4.2.2
71+
72+
- name: 🐍 set up python
73+
uses: actions/setup-python@v5
74+
with:
75+
python-version: "${{ matrix.python_version }}"
76+
77+
- name: install dependencies
78+
run: |
79+
python -m pip install --upgrade pip
80+
pip install -r test-requirements.txt
81+
82+
- name: force reinstall of community.docker
83+
run: |
84+
mkdir -p /home/runner/.ansible/collections
85+
ansible-galaxy collection install community.docker --force
86+
87+
- name: Install collection
88+
run: |
89+
make \
90+
install
91+
92+
- name: test ${{ matrix.collection_role }} - ${{ matrix.scenario }}
93+
run: |
94+
make \
95+
test \
96+
-e TOX_ANSIBLE="ansible_${{ matrix.ansible-version }}" \
97+
-e DISTRIBUTION="${{ matrix.image }}" \
98+
-e COLLECTION_ROLE="${{ matrix.collection_role }}" \
99+
-e COLLECTION_SCENARIO="${{ matrix.scenario }}"
100+
101+
ubuntu:
102+
name: "${{ matrix.image }} / ${{ matrix.scenario }} / ${{ matrix.ansible-version }} / ${{ matrix.python_version }}"
103+
runs-on: ubuntu-22.04
104+
needs:
105+
- debian
106+
strategy:
107+
fail-fast: false
108+
matrix:
109+
image:
110+
- ubuntu:22.04
111+
ansible-version:
112+
- '9.5'
113+
python_version:
114+
- '3.12'
115+
scenario:
116+
- default
117+
collection_role:
118+
- pihole
119+
120+
steps:
121+
- name: check out the codebase.
122+
uses: actions/checkout@v4.2.2
123+
124+
- name: 🐍 set up python
125+
uses: actions/setup-python@v5
126+
with:
127+
python-version: "${{ matrix.python_version }}"
128+
129+
- name: install dependencies
130+
run: |
131+
python -m pip install --upgrade pip
132+
pip install -r test-requirements.txt
133+
134+
- name: force reinstall of community.docker
135+
run: |
136+
mkdir -p /home/runner/.ansible/collections
137+
ansible-galaxy collection install community.docker --force
138+
139+
- name: Install collection
140+
run: |
141+
make \
142+
install
143+
144+
- name: test ${{ matrix.collection_role }} - ${{ matrix.scenario }}
145+
run: |
146+
make \
147+
test \
148+
-e TOX_ANSIBLE="ansible_${{ matrix.ansible-version }}" \
149+
-e DISTRIBUTION="${{ matrix.image }}" \
150+
-e COLLECTION_ROLE="${{ matrix.collection_role }}" \
151+
-e COLLECTION_SCENARIO="${{ matrix.scenario }}"
152+
153+
scenarios:
154+
name: "${{ matrix.image }} / ${{ matrix.scenario }} / ${{ matrix.ansible-version }} / ${{ matrix.python_version }}"
155+
runs-on: ubuntu-22.04
156+
needs:
157+
- debian
158+
strategy:
159+
fail-fast: false
160+
matrix:
161+
image:
162+
- debian:12
163+
ansible-version:
164+
- '9.5'
165+
python_version:
166+
- '3.12'
167+
scenario:
168+
- configured
169+
- family-friendly
170+
collection_role:
171+
- pihole
172+
173+
steps:
174+
- name: check out the codebase.
175+
uses: actions/checkout@v4.2.2
176+
with:
177+
ref: ${{ github.event.workflow_run.head_branch }}
178+
179+
- name: 🐍 set up python
180+
uses: actions/setup-python@v5
181+
with:
182+
python-version: "${{ matrix.python_version }}"
183+
184+
- name: install dependencies
185+
run: |
186+
python -m pip install --upgrade pip
187+
pip install -r test-requirements.txt
188+
189+
- name: force reinstall of community.docker
190+
run: |
191+
mkdir -p /home/runner/.ansible/collections
192+
ansible-galaxy collection install community.docker --force
193+
194+
- name: Install collection
195+
run: |
196+
make \
197+
install
198+
199+
- name: test ${{ matrix.collection_role }} - ${{ matrix.scenario }}
200+
run: |
201+
make \
202+
test \
203+
-e TOX_ANSIBLE="ansible_${{ matrix.ansible-version }}" \
204+
-e DISTRIBUTION="${{ matrix.image }}" \
205+
-e COLLECTION_ROLE="${{ matrix.collection_role }}" \
206+
-e COLLECTION_SCENARIO="${{ matrix.scenario }}"

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace: bodsch
44
name: dns
55

6-
version: 1.0.1
6+
version: 1.1.0
77

88
readme: README.md
99

0 commit comments

Comments
 (0)