Skip to content

Commit 8dce885

Browse files
committed
ci: setup workflow for molecule testing
Signed-off-by: Zakhar Bessarab <[email protected]>
1 parent eaa856f commit 8dce885

File tree

10 files changed

+41
-13
lines changed

10 files changed

+41
-13
lines changed

.ansible-lint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
skip_list:
2+
- 'var-naming[no-role-prefix]'

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: 'Molecule Test'
2+
on:
3+
pull_request: { }
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
lint:
10+
name: 'Test'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: 'Checkout'
14+
uses: actions/checkout@v4
15+
16+
- name: Cache .venv directory
17+
uses: actions/cache@v3
18+
with:
19+
path: .venv
20+
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements.txt') }}
21+
22+
- name: Converge
23+
run: |
24+
make init-venv
25+
26+
make molecule-converge

roles/cluster/molecule/default/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
ansible.builtin.get_url:
1818
url: "{{ goss_url }}"
1919
dest: "{{ goss_bin }}"
20-
sha256sum: "{{ goss_sha256sum }}"
20+
sha256sum: "{{ goss_sha256sum }}" # noqa: args[module]
2121
mode: "u=rwx,go=rx"
2222
register: download_goss
2323
until: download_goss is succeeded

roles/single/tasks/install.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
- not victoriametrics_is_installed.stat.exists or
7373
victoriametrics_version not in victoriametrics_current_version.stdout
7474

75-
- name: Upload VictoriaMetrics release binary
75+
- name: Upload VictoriaMetrics release binary # noqa: no-handler
7676
ansible.builtin.copy:
7777
src: /tmp/vic-single/victoria-metrics-prod
7878
dest: /usr/local/bin
@@ -82,7 +82,7 @@
8282
when:
8383
- archive_downloaded is changed
8484

85-
- name: Download VictoriaMetrics utils
85+
- name: Download VictoriaMetrics utils # noqa: no-handler
8686
become: no
8787
environment:
8888
http_proxy: ''
@@ -95,7 +95,7 @@
9595
when:
9696
- archive_downloaded is changed
9797

98-
- name: Upload VictoriaMetrics release binaries
98+
- name: Upload VictoriaMetrics release binaries # noqa: no-handler
9999
ansible.builtin.copy:
100100
src: "/tmp/vic-utils/{{ item }}"
101101
dest: /usr/local/bin

roles/single/tests/playbook.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
- hosts: all
3-
name: Test role
2+
- name: Test role
3+
hosts: all
44
become: true
55
roles:
66
- "single"

roles/vmagent/molecule/default/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
ansible.builtin.get_url:
1818
url: "{{ goss_url }}"
1919
dest: "{{ goss_bin }}"
20-
sha256sum: "{{ goss_sha256sum }}"
20+
sha256sum: "{{ goss_sha256sum }}" # noqa: args[module]
2121
mode: "u=rwx,go=rx"
2222
register: download_goss
2323
until: download_goss is succeeded

roles/vmagent/molecule/docker/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
ansible.builtin.get_url:
1818
url: "{{ goss_url }}"
1919
dest: "{{ goss_bin }}"
20-
sha256sum: "{{ goss_sha256sum }}"
20+
sha256sum: "{{ goss_sha256sum }}" # noqa: args[module]
2121
mode: "u=rwx,go=rx"
2222
register: download_goss
2323
until: download_goss is succeeded

roles/vmagent/tasks/configure.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
no_log: True
1414
notify: Restart VMagent service
1515

16-
- name: "Systemd | daemon-reload VMagent service"
16+
- name: "Systemd | daemon-reload VMagent service" # noqa: no-handler
1717
become: true
1818
ansible.builtin.systemd:
1919
daemon_reload: true
@@ -38,7 +38,7 @@
3838
notify: Restart VMagent service
3939
register: config_template
4040

41-
- name: "Upstart | Enable vic-vmagent service"
41+
- name: "Upstart | Enable vic-vmagent service" # noqa: no-handler
4242
ansible.builtin.service:
4343
name: "vic-vmagent"
4444
enabled: "yes"

roles/vmalert/tasks/configure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
notify: Restart VMalert service
1414
no_log: True
1515

16-
- name: "Systemd | daemon-reload VMalert service"
16+
- name: "Systemd | daemon-reload VMalert service" # noqa: no-handler
1717
become: true
1818
ansible.builtin.systemd:
1919
daemon_reload: true

roles/vmalert/tests/playbook.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
- hosts: all
3-
name: Test vmalert role
2+
- name: Test vmalert role
3+
hosts: all
44
become: true
55
roles:
66
- "vmalert"

0 commit comments

Comments
 (0)