Skip to content

Commit 4c5d604

Browse files
Import linting, split linting tasks
1 parent 3865ff9 commit 4c5d604

File tree

3 files changed

+28
-59
lines changed

3 files changed

+28
-59
lines changed

.github/workflows/lint.yml

+26-7
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ env:
1111

1212
jobs:
1313

14-
lint-test:
15-
name: Lint for push
14+
ansible-lint:
15+
name: Ansible Lint
1616
runs-on: ubuntu-latest
1717

1818
steps:
@@ -25,16 +25,35 @@ jobs:
2525
python-version: '3.x'
2626

2727
- name: Install test dependencies.
28-
run: pip3 install yamllint ansible-lint ansible
28+
run: pip3 install ansible-lint ansible
2929

3030
- name: Version check
3131
run: |
3232
ansible --version
3333
ansible-lint --version
34+
35+
- name: Run ansible-lint.
36+
run: ansible-lint
37+
38+
yaml-lint:
39+
name: YAML Lint
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- name: Check out the codebase.
44+
uses: actions/checkout@v3
45+
46+
- name: Set up Python.
47+
uses: actions/setup-python@v4
48+
with:
49+
python-version: '3.x'
50+
51+
- name: Install test dependencies.
52+
run: pip3 install yamllint
53+
54+
- name: Version check
55+
run: |
3456
yamllint --version
3557
3658
- name: Run yamllint.
37-
run: yamllint .
38-
39-
- name: Run ansible-lint.
40-
run: ansible-lint
59+
run: yamllint .

.github/workflows/rocky8.yml

+1-27
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,11 @@ on:
55
pull_request:
66
workflow_dispatch:
77

8-
9-
108
jobs:
11-
129
lint-test:
13-
name: Lint for PR
1410
runs-on: ubuntu-latest
15-
1611
steps:
17-
- name: Check out the codebase.
18-
uses: actions/checkout@v3
19-
20-
- name: Set up Python.
21-
uses: actions/setup-python@v4
22-
with:
23-
python-version: '3.x'
24-
25-
- name: Install test dependencies.
26-
run: pip3 install yamllint ansible-lint ansible
27-
28-
- name: Version check
29-
run: |
30-
ansible --version
31-
ansible-lint --version
32-
yamllint --version
33-
34-
- name: Run yamllint.
35-
run: yamllint .
36-
37-
- name: Run ansible-lint.
38-
run: ansible-lint
12+
- uses: rancherfederal/rke2-ansible/.github/workflows/lint.yaml
3913

4014
rocky8-test:
4115
name: Ansible build test for Rocky 8

.github/workflows/ubuntu20.yml

+1-25
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,10 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
109
lint-test:
11-
name: Lint for PR
1210
runs-on: ubuntu-latest
13-
1411
steps:
15-
- name: Check out the codebase.
16-
uses: actions/checkout@v3
17-
18-
- name: Set up Python.
19-
uses: actions/setup-python@v4
20-
with:
21-
python-version: '3.x'
22-
23-
- name: Install test dependencies.
24-
run: pip3 install yamllint ansible-lint ansible
25-
26-
- name: Version check
27-
run: |
28-
ansible --version
29-
ansible-lint --version
30-
yamllint --version
31-
32-
- name: Run yamllint.
33-
run: yamllint .
34-
35-
- name: Run ansible-lint.
36-
run: ansible-lint
12+
- uses: rancherfederal/rke2-ansible/.github/workflows/lint.yaml
3713

3814
ubuntu20-test:
3915
name: Ansible build test for Ubuntu

0 commit comments

Comments
 (0)