Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 3 additions & 20 deletions .github/workflows/test_full_stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,10 @@ on:
- cron: "0 4 * * *"

jobs:

lint_full:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v3

- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install test dependencies.
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-test.txt

- name: Lint code.
run: |
yamllint .
ansible-lint roles/
uses: ./.github/workflows/test_linting.yml
with:
rolename: ''

molecule_full_stack_every_os:
runs-on: ubuntu-latest
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/test_linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: Test Linting
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
workflow_call:
inputs:
rolename:
required: true
type: string
push:
branches:
- 'feature/**'
- 'fix/**'
- '!doc/**'
paths:
- '.github/workflows/test_linting.yml'
- '.config/ansible-lint.yml'
- '.yamllint'
pull_request:
branches:
- 'feature/**'
- 'fix/**'
- '!doc/**'
paths:
- '.github/workflows/test_linting.yml'
- '.config/ansible-lint.yml'
- '.yamllint'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v3

- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install test dependencies.
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-test.txt

- name: Lint code (yamllint).
run: |
yamllint .
if: ${{ inputs.rolename == '' }}

- name: Lint Role (yamllint).
run: |
ansible-lint roles/${{ inputs.rolename }}
if: ${{ inputs.rolename != '' }}

- name: Lint Role (ansible-lint).
run: |
ansible-lint roles/${{ inputs.rolename }}
26 changes: 3 additions & 23 deletions .github/workflows/test_role_beats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ on:
- 'roles/beats/**'
- '.github/workflows/test_role_beats.yml'
- 'molecule/beats_**'
- '.config/ansible-lint.yml'
- '.yamllint'
pull_request:
branches:
- 'feature/**'
Expand All @@ -32,30 +30,12 @@ on:
- 'roles/beats/**'
- '.github/workflows/test_role_beats.yml'
- 'molecule/beats_**'
- '.config/ansible-lint.yml'
- '.yamllint'

jobs:
lint_beats:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v3

- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install test dependencies.
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-test.txt

- name: Lint code.
run: |
yamllint roles/beats/
ansible-lint roles/beats/
uses: ./.github/workflows/test_linting.yml
with:
rolename: beats

molecule_beats:
needs: lint_beats
Expand Down
26 changes: 3 additions & 23 deletions .github/workflows/test_role_elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ on:
- 'roles/elasticsearch/**'
- '.github/workflows/test_role_elasticsearch.yml'
- 'molecule/elasticsearch_**'
- '.config/ansible-lint.yml'
- '.yamllint'
pull_request:
branches:
- 'feature/**'
Expand All @@ -32,30 +30,12 @@ on:
- 'roles/elasticsearch/**'
- '.github/workflows/test_role_elasticsearch.yml'
- 'molecule/elasticsearch_**'
- '.config/ansible-lint.yml'
- '.yamllint'

jobs:
lint_elasticsearch:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v3

- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install test dependencies.
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-test.txt

- name: Lint code.
run: |
yamllint roles/elasticsearch/
ansible-lint roles/elasticsearch/
uses: ./.github/workflows/test_linting.yml
with:
rolename: elasticsearch

molecule_elasticsearch:
needs: lint_elasticsearch
Expand Down
25 changes: 3 additions & 22 deletions .github/workflows/test_role_kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ on:
- 'roles/kibana/**'
- '.github/workflows/test_role_kibana.yml'
- 'molecule/kibana_**'
- '.config/ansible-lint.yml'
- '.yamllint'
pull_request:
branches:
- 'feature/**'
Expand All @@ -32,30 +30,13 @@ on:
- 'roles/kibana/**'
- '.github/workflows/test_role_kibana.yml'
- 'molecule/kibana_**'
- '.config/ansible-lint.yml'
- '.yamllint'

jobs:
lint_kibana:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v3

- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.x'
uses: ./.github/workflows/test_linting.yml
with:
rolename: kibana

- name: Install test dependencies.
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-test.txt

- name: Lint code.
run: |
yamllint roles/kibana/
ansible-lint roles/kibana/

molecule_kibana:
needs: lint_kibana
Expand Down
25 changes: 3 additions & 22 deletions .github/workflows/test_role_logstash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ on:
- 'roles/logstash/**'
- '.github/workflows/test_role_logstash.yml'
- 'molecule/logstash_**'
- '.config/ansible-lint.yml'
- '.yamllint'
pull_request:
branches:
- 'feature/**'
Expand All @@ -32,30 +30,13 @@ on:
- 'roles/logstash/**'
- '.github/workflows/test_role_logstash.yml'
- 'molecule/logstash_**'
- '.config/ansible-lint.yml'
- '.yamllint'

jobs:
lint_logstash:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v3

- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.x'
uses: ./.github/workflows/test_linting.yml
with:
rolename: logstash

- name: Install test dependencies.
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-test.txt

- name: Lint code.
run: |
yamllint roles/logstash/
ansible-lint roles/logstash/

molecule_logstash_extended:
runs-on: ubuntu-latest
Expand Down
26 changes: 3 additions & 23 deletions .github/workflows/test_role_repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ on:
- 'roles/repos/**'
- '.github/workflows/test_role_repos.yml'
- 'molecule/repos_**'
- '.config/ansible-lint.yml'
- '.yamllint'
pull_request:
branches:
- 'feature/**'
Expand All @@ -31,30 +29,12 @@ on:
- 'roles/repos/**'
- '.github/workflows/test_role_repos.yml'
- 'molecule/repos_**'
- '.config/ansible-lint.yml'
- '.yamllint'

jobs:
lint_repos:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v3

- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install test dependencies.
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-test.txt

- name: Lint code.
run: |
yamllint roles/repos/
ansible-lint roles/repos/
uses: ./.github/workflows/test_linting.yml
with:
rolename: repos

molecule_repos:
needs: lint_repos
Expand Down
25 changes: 3 additions & 22 deletions .github/workflows/test_roles_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ on:
- 'roles/**'
- '.github/workflows/test_roles_pr.yml'
- 'molecule/elasticstack_default/**'
- '.config/ansible-lint.yml'
- '.yamllint'
push:
branches:
- 'feature/**'
Expand All @@ -32,30 +30,13 @@ on:
- 'roles/**'
- '.github/workflows/test_roles_pr.yml'
- 'molecule/elasticstack_default/**'
- '.config/ansible-lint.yml'
- '.yamllint'

jobs:
lint_full:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v3

- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.x'
uses: ./.github/workflows/test_linting.yml
with:
rolename: ''

- name: Install test dependencies.
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-test.txt

- name: Lint code.
run: |
yamllint .
ansible-lint roles/
molecule_full_stack:
runs-on: ubuntu-latest
needs: lint_full
Expand Down