-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (25 loc) · 1.18 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
name: "Linting"
on: ["push"]
jobs:
ansible-lint:
name: "Lint"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v3"
- name: "Check for trailing whitespaces"
run: "grep --exclude-dir='.git' --exclude='*.md' --exclude='*.png' --files-with-matches --recursive '[[:blank:]]$' && exit 1 || echo 'No trailing whitespaces found.'"
- name: "Check for files with the yml extension"
run: "if [[ -n $(find . -iname '*.yml') ]]; then exit 1; fi"
- uses: "actions/setup-python@v3"
- name: "Install dependencies"
run: "pip install --no-cache-dir --upgrade --quiet ansible ansible-lint black"
- name: "Disable Vault Password"
run: "sed --in-place --expression 's/vault_password_file/# vault_password_file/' ansible.cfg"
- name: "Run ansible-lint"
run: "ansible-lint -q"
- name: "Run shellcheck"
run: "find . -type f -name '*.sh*' -exec shellcheck {} \\;"
- name: "Run black"
run: "black --include='\\.py(?:\\.j2)?' --check ."