File tree Expand file tree Collapse file tree 8 files changed +89
-155
lines changed Expand file tree Collapse file tree 8 files changed +89
-155
lines changed Original file line number Diff line number Diff line change 16
16
- cron : " 0 4 * * *"
17
17
18
18
jobs :
19
-
20
19
lint_full :
21
- runs-on : ubuntu-latest
22
- steps :
23
- - name : Check out the codebase.
24
- uses : actions/checkout@v3
25
-
26
- - name : Set up Python 3.
27
- uses : actions/setup-python@v4
28
- with :
29
- python-version : ' 3.x'
30
-
31
- - name : Install test dependencies.
32
- run : |
33
- python3 -m pip install --upgrade pip
34
- python3 -m pip install -r requirements-test.txt
35
-
36
- - name : Lint code.
37
- run : |
38
- yamllint .
39
- ansible-lint roles/
20
+ uses : ./.github/workflows/test_linting.yml
21
+ with :
22
+ rolename : ' '
40
23
41
24
molecule_full_stack_every_os :
42
25
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change
1
+ ---
2
+ name : Test Linting
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ logLevel :
7
+ description : ' Log level'
8
+ required : true
9
+ default : ' warning'
10
+ type : choice
11
+ options :
12
+ - info
13
+ - warning
14
+ - debug
15
+ workflow_call :
16
+ inputs :
17
+ rolename :
18
+ required : true
19
+ type : string
20
+ push :
21
+ branches :
22
+ - ' feature/**'
23
+ - ' fix/**'
24
+ - ' !doc/**'
25
+ paths :
26
+ - ' .github/workflows/test_linting.yml'
27
+ - ' .config/ansible-lint.yml'
28
+ - ' .yamllint'
29
+ pull_request :
30
+ branches :
31
+ - ' feature/**'
32
+ - ' fix/**'
33
+ - ' !doc/**'
34
+ paths :
35
+ - ' .github/workflows/test_linting.yml'
36
+ - ' .config/ansible-lint.yml'
37
+ - ' .yamllint'
38
+
39
+ jobs :
40
+ lint :
41
+ runs-on : ubuntu-latest
42
+ steps :
43
+ - name : Check out the codebase.
44
+ uses : actions/checkout@v3
45
+
46
+ - name : Set up Python 3.
47
+ uses : actions/setup-python@v4
48
+ with :
49
+ python-version : ' 3.x'
50
+
51
+ - name : Install test dependencies.
52
+ run : |
53
+ python3 -m pip install --upgrade pip
54
+ python3 -m pip install -r requirements-test.txt
55
+
56
+ - name : Lint code (yamllint).
57
+ run : |
58
+ yamllint .
59
+ if : ${{ inputs.rolename == '' }}
60
+
61
+ - name : Lint Role (yamllint).
62
+ run : |
63
+ ansible-lint roles/${{ inputs.rolename }}
64
+ if : ${{ inputs.rolename != '' }}
65
+
66
+ - name : Lint Role (ansible-lint).
67
+ run : |
68
+ ansible-lint roles/${{ inputs.rolename }}
Original file line number Diff line number Diff line change 21
21
- ' roles/beats/**'
22
22
- ' .github/workflows/test_role_beats.yml'
23
23
- ' molecule/beats_**'
24
- - ' .config/ansible-lint.yml'
25
- - ' .yamllint'
26
24
pull_request :
27
25
branches :
28
26
- ' feature/**'
32
30
- ' roles/beats/**'
33
31
- ' .github/workflows/test_role_beats.yml'
34
32
- ' molecule/beats_**'
35
- - ' .config/ansible-lint.yml'
36
- - ' .yamllint'
37
33
38
34
jobs :
39
35
lint_beats :
40
- runs-on : ubuntu-latest
41
- steps :
42
- - name : Check out the codebase.
43
- uses : actions/checkout@v3
44
-
45
- - name : Set up Python 3.
46
- uses : actions/setup-python@v4
47
- with :
48
- python-version : ' 3.x'
49
-
50
- - name : Install test dependencies.
51
- run : |
52
- python3 -m pip install --upgrade pip
53
- python3 -m pip install -r requirements-test.txt
54
-
55
- - name : Lint code.
56
- run : |
57
- yamllint roles/beats/
58
- ansible-lint roles/beats/
36
+ uses : ./.github/workflows/test_linting.yml
37
+ with :
38
+ rolename : beats
59
39
60
40
molecule_beats :
61
41
needs : lint_beats
Original file line number Diff line number Diff line change 21
21
- ' roles/elasticsearch/**'
22
22
- ' .github/workflows/test_role_elasticsearch.yml'
23
23
- ' molecule/elasticsearch_**'
24
- - ' .config/ansible-lint.yml'
25
- - ' .yamllint'
26
24
pull_request :
27
25
branches :
28
26
- ' feature/**'
32
30
- ' roles/elasticsearch/**'
33
31
- ' .github/workflows/test_role_elasticsearch.yml'
34
32
- ' molecule/elasticsearch_**'
35
- - ' .config/ansible-lint.yml'
36
- - ' .yamllint'
37
33
38
34
jobs :
39
35
lint_elasticsearch :
40
- runs-on : ubuntu-latest
41
- steps :
42
- - name : Check out the codebase.
43
- uses : actions/checkout@v3
44
-
45
- - name : Set up Python 3.
46
- uses : actions/setup-python@v4
47
- with :
48
- python-version : ' 3.x'
49
-
50
- - name : Install test dependencies.
51
- run : |
52
- python3 -m pip install --upgrade pip
53
- python3 -m pip install -r requirements-test.txt
54
-
55
- - name : Lint code.
56
- run : |
57
- yamllint roles/elasticsearch/
58
- ansible-lint roles/elasticsearch/
36
+ uses : ./.github/workflows/test_linting.yml
37
+ with :
38
+ rolename : elasticsearch
59
39
60
40
molecule_elasticsearch :
61
41
needs : lint_elasticsearch
Original file line number Diff line number Diff line change 21
21
- ' roles/kibana/**'
22
22
- ' .github/workflows/test_role_kibana.yml'
23
23
- ' molecule/kibana_**'
24
- - ' .config/ansible-lint.yml'
25
- - ' .yamllint'
26
24
pull_request :
27
25
branches :
28
26
- ' feature/**'
32
30
- ' roles/kibana/**'
33
31
- ' .github/workflows/test_role_kibana.yml'
34
32
- ' molecule/kibana_**'
35
- - ' .config/ansible-lint.yml'
36
- - ' .yamllint'
37
33
38
34
jobs :
39
35
lint_kibana :
40
- runs-on : ubuntu-latest
41
- steps :
42
- - name : Check out the codebase.
43
- uses : actions/checkout@v3
44
-
45
- - name : Set up Python 3.
46
- uses : actions/setup-python@v4
47
- with :
48
- python-version : ' 3.x'
36
+ uses : ./.github/workflows/test_linting.yml
37
+ with :
38
+ rolename : kibana
49
39
50
- - name : Install test dependencies.
51
- run : |
52
- python3 -m pip install --upgrade pip
53
- python3 -m pip install -r requirements-test.txt
54
-
55
- - name : Lint code.
56
- run : |
57
- yamllint roles/kibana/
58
- ansible-lint roles/kibana/
59
40
60
41
molecule_kibana :
61
42
needs : lint_kibana
Original file line number Diff line number Diff line change 21
21
- ' roles/logstash/**'
22
22
- ' .github/workflows/test_role_logstash.yml'
23
23
- ' molecule/logstash_**'
24
- - ' .config/ansible-lint.yml'
25
- - ' .yamllint'
26
24
pull_request :
27
25
branches :
28
26
- ' feature/**'
32
30
- ' roles/logstash/**'
33
31
- ' .github/workflows/test_role_logstash.yml'
34
32
- ' molecule/logstash_**'
35
- - ' .config/ansible-lint.yml'
36
- - ' .yamllint'
37
33
38
34
jobs :
39
35
lint_logstash :
40
- runs-on : ubuntu-latest
41
- steps :
42
- - name : Check out the codebase.
43
- uses : actions/checkout@v3
44
-
45
- - name : Set up Python 3.
46
- uses : actions/setup-python@v4
47
- with :
48
- python-version : ' 3.x'
36
+ uses : ./.github/workflows/test_linting.yml
37
+ with :
38
+ rolename : logstash
49
39
50
- - name : Install test dependencies.
51
- run : |
52
- python3 -m pip install --upgrade pip
53
- python3 -m pip install -r requirements-test.txt
54
-
55
- - name : Lint code.
56
- run : |
57
- yamllint roles/logstash/
58
- ansible-lint roles/logstash/
59
40
60
41
molecule_logstash_extended :
61
42
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 20
20
- ' roles/repos/**'
21
21
- ' .github/workflows/test_role_repos.yml'
22
22
- ' molecule/repos_**'
23
- - ' .config/ansible-lint.yml'
24
- - ' .yamllint'
25
23
pull_request :
26
24
branches :
27
25
- ' feature/**'
31
29
- ' roles/repos/**'
32
30
- ' .github/workflows/test_role_repos.yml'
33
31
- ' molecule/repos_**'
34
- - ' .config/ansible-lint.yml'
35
- - ' .yamllint'
36
32
37
33
jobs :
38
34
lint_repos :
39
- runs-on : ubuntu-latest
40
- steps :
41
- - name : Check out the codebase.
42
- uses : actions/checkout@v3
43
-
44
- - name : Set up Python 3.
45
- uses : actions/setup-python@v4
46
- with :
47
- python-version : ' 3.x'
48
-
49
- - name : Install test dependencies.
50
- run : |
51
- python3 -m pip install --upgrade pip
52
- python3 -m pip install -r requirements-test.txt
53
-
54
- - name : Lint code.
55
- run : |
56
- yamllint roles/repos/
57
- ansible-lint roles/repos/
35
+ uses : ./.github/workflows/test_linting.yml
36
+ with :
37
+ rolename : repos
58
38
59
39
molecule_repos :
60
40
needs : lint_repos
Original file line number Diff line number Diff line change 21
21
- ' roles/**'
22
22
- ' .github/workflows/test_roles_pr.yml'
23
23
- ' molecule/elasticstack_default/**'
24
- - ' .config/ansible-lint.yml'
25
- - ' .yamllint'
26
24
push :
27
25
branches :
28
26
- ' feature/**'
32
30
- ' roles/**'
33
31
- ' .github/workflows/test_roles_pr.yml'
34
32
- ' molecule/elasticstack_default/**'
35
- - ' .config/ansible-lint.yml'
36
- - ' .yamllint'
37
33
38
34
jobs :
39
35
lint_full :
40
- runs-on : ubuntu-latest
41
- steps :
42
- - name : Check out the codebase.
43
- uses : actions/checkout@v3
44
-
45
- - name : Set up Python 3.
46
- uses : actions/setup-python@v4
47
- with :
48
- python-version : ' 3.x'
36
+ uses : ./.github/workflows/test_linting.yml
37
+ with :
38
+ rolename : ' '
49
39
50
- - name : Install test dependencies.
51
- run : |
52
- python3 -m pip install --upgrade pip
53
- python3 -m pip install -r requirements-test.txt
54
-
55
- - name : Lint code.
56
- run : |
57
- yamllint .
58
- ansible-lint roles/
59
40
molecule_full_stack :
60
41
runs-on : ubuntu-latest
61
42
needs : lint_full
You can’t perform that action at this time.
0 commit comments