-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add docs to the README
- Loading branch information
Showing
2 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters