-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (60 loc) · 1.89 KB
/
ansible-lint.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
name: python-linting
'on':
workflow_call:
inputs:
additional_packages:
default: ''
description: String of additional packages that should be installed.
required: false
type: string
jobs_run_on:
default: ubuntu-latest
description: The runner group on which jobs will run.
required: false
type: string
python_version:
description: The version of Python to use for the run.
default: '3.11'
required: false
type: string
timeout_minutes:
description: The maximum time (in minutes) for a job to run.
default: 5
required: false
type: number
working_directory:
description: The working directory where all jobs should be executed.
default: '.'
required: false
type: string
jobs:
linting:
defaults:
run:
working-directory: ${{ inputs.working_directory }}
runs-on: ${{ inputs.jobs_run_on }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install additional packages
if: ${{ inputs.additional_packages != '' }}
run: sudo apt-get install -y ${{ inputs.additional_packages }}
- name: Install poetry
run: pipx install poetry
- name: "Set up Python ${{ inputs.python_version }}"
uses: actions/setup-python@v5
with:
cache: poetry
python-version: "${{ inputs.python_version }}"
- name: Configure Poetry
run: poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install
- name: Ansible-lint version
run: poetry run ansible-lint --version
- name: Lint with yamllint
run: poetry run yamllint . -s
- name: Lint with ansible-lint
run: poetry run ansible-lint -s --offline
timeout-minutes: ${{ inputs.timeout_minutes }}