-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (49 loc) · 1.68 KB
/
pre-commit.yml
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
---
# This workflow action will run pre-commit, which will execute ansible and yaml linting
# See .pre-commit-config.yaml for what hooks are executed
name: pre-commit tests
on:
workflow_call:
inputs:
collection_namespace:
description: "Install collection python dependencies"
required: true
type: string
collection_name:
description: "Path to the collection source"
required: true
type: string
collection_version:
description: The final collection path
required: false
type: string
collection_repo:
description: The collection url
required: false
type: string
collection_dependencies:
description: The collection dependencies (as a space separated list)
required: false
type: string
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Ansible
run: pip install --upgrade ansible-core pyyaml==6.0.1
- name: Build and install the collection
uses: redhat-cop/ansible_collections_tooling/actions/build_ansible_collection@main
with:
collection_namespace: ${{ inputs.collection_namespace }}
collection_name: ${{ inputs.collection_name }}
collection_version: ${{ inputs.collection_version }}
collection_repo: ${{ inputs.collection_repo }}
- name: Install collection dependencies
run: ansible-galaxy collection install ${{ inputs.collection_dependencies }}
if: inputs.collection_dependencies
- uses: pre-commit/action@v3.0.1
...