Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI, pre-commit hooks #269

Open
wants to merge 18 commits into
base: devel
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
exclude_paths:
- .pre-commit-config.yaml
- icingaagents.yml
- roles/common/handlers/main.yml
- authzkeys.yml
- inventories
offline: false
skip_list:
- role-name
13 changes: 13 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# .github/workflows/ansible-lint.yml
name: ansible-lint
on:
pull_request:
branches: ["main"]
brucellino marked this conversation as resolved.
Show resolved Hide resolved
jobs:
build:
name: Ansible Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ansible-lint
uses: ansible/[email protected]
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
.LSOverride

# Icon must end with two \r
Icon
Icon


# Thumbnails
._*
Expand All @@ -25,3 +26,6 @@ Network Trash Folder
Temporary Items
.apdisk
# END OSX.gitignore

# ignore editor cruft
.vscode
44 changes: 44 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: requirements-txt-fixer

- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args:
- --baseline
- .secrets.baseline

- repo: https://github.com/ansible-community/ansible-lint
rev: v24.2.1
hooks:
- id: ansible-lint
always_run: false
files: ^.*.yml
exclude: .github
additional_dependencies:
- ansible-core>=2.16.0
brucellino marked this conversation as resolved.
Show resolved Hide resolved
args:
- --exclude
- .pre-commit-config.yaml
- icingaagents.yml
# For some reason noqa is not being picked up on these files
- roles/common/handlers/main.yml
- authzkeys.yml
# ssp-modules is a bad name for a role
- roles/ssp-modules

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
hooks:
- id: check-github-workflows
- id: check-dependabot
Loading