Skip to content

Commit

Permalink
Add linting workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tbauriedel committed Dec 28, 2023
1 parent e254430 commit 16e375b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Yamllint

Check warning on line 1 in .github/workflows/yamllint.yml

View workflow job for this annotation

GitHub Actions / yamllint

1:1 [document-start] missing document start "---"

on:

Check warning on line 3 in .github/workflows/yamllint.yml

View workflow job for this annotation

GitHub Actions / yamllint

3:1 [truthy] truthy value should be one of [false, true]
workflow_call:
inputs:
rolename:
required: true
type: string
push:
branches:
- "*"
pull_request:
branches:
- "*"

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

- 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 }}
2 changes: 2 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ansible
ansible-lint

0 comments on commit 16e375b

Please sign in to comment.