|
1 | | -name: CI |
2 | | - |
3 | | -on: |
4 | | - pull_request: |
5 | | - branches: [ master ] |
6 | | - |
7 | | -jobs: |
8 | | - ansible-syntax: |
9 | | - runs-on: ubuntu-latest |
10 | | - name: Ansible Syntax Check |
11 | | - |
12 | | - steps: |
13 | | - - name: Checkout code |
14 | | - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 |
15 | | - |
16 | | - - name: Set up Python |
17 | | - uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4 |
18 | | - with: |
19 | | - python-version: '3.11' |
20 | | - |
21 | | - - name: Install Ansible |
22 | | - run: | |
23 | | - python -m pip install --upgrade pip |
24 | | - pip install ansible ansible-lint |
25 | | -
|
26 | | - - name: Install PAN-OS collection |
27 | | - run: | |
28 | | - ansible-galaxy collection install paloaltonetworks.panos |
29 | | -
|
30 | | - - name: Ansible syntax check |
31 | | - run: | |
32 | | - find playbooks -name "*.yml" -exec ansible-playbook --syntax-check {} \; |
33 | | -
|
34 | | - - name: Ansible lint |
35 | | - run: | |
36 | | - ansible-lint playbooks/ |
37 | | -
|
38 | | - python-tests: |
39 | | - runs-on: ubuntu-latest |
40 | | - name: Python Filter Tests |
41 | | - |
42 | | - steps: |
43 | | - - name: Checkout code |
44 | | - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 |
45 | | - |
46 | | - - name: Set up Python |
47 | | - uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4 |
48 | | - with: |
49 | | - python-version: '3.11' |
50 | | - |
51 | | - - name: Install dependencies |
52 | | - run: | |
53 | | - python -m pip install --upgrade pip |
54 | | - pip install pytest |
55 | | -
|
56 | | - - name: Run custom filter tests |
57 | | - run: | |
58 | | - cd filter_plugins |
59 | | - python -m pytest test_custom_filters.py -v |
60 | | -
|
61 | | - secrets-scan: |
62 | | - runs-on: ubuntu-latest |
63 | | - name: Secrets Scanning |
64 | | - |
65 | | - steps: |
66 | | - - name: Checkout code |
67 | | - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 |
68 | | - with: |
69 | | - |
70 | | - fetch-depth: 0 |
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [ master ] |
| 6 | + |
| 7 | +jobs: |
| 8 | + ansible-syntax: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + name: Ansible Syntax Check |
| 11 | + |
| 12 | + steps: |
| 13 | + - name: Checkout code |
| 14 | + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 |
| 15 | + |
| 16 | + - name: Set up Python |
| 17 | + uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4 |
| 18 | + with: |
| 19 | + python-version: '3.11' |
| 20 | + |
| 21 | + - name: Install Ansible |
| 22 | + run: | |
| 23 | + python -m pip install --upgrade pip |
| 24 | + pip install ansible ansible-lint |
| 25 | +
|
| 26 | + - name: Install PAN-OS collection |
| 27 | + run: | |
| 28 | + ansible-galaxy collection install paloaltonetworks.panos |
| 29 | +
|
| 30 | + - name: Ansible syntax check |
| 31 | + run: | |
| 32 | + find playbooks -name "*.yml" -exec ansible-playbook --syntax-check {} \; |
| 33 | +
|
| 34 | + - name: Ansible lint |
| 35 | + run: | |
| 36 | + ansible-lint playbooks/ |
| 37 | +
|
| 38 | + - name: Ansible Sanity Check |
| 39 | + run: | |
| 40 | + ansible-test sanity |
| 41 | +
|
| 42 | + python-tests: |
| 43 | + runs-on: ubuntu-latest |
| 44 | + name: Python Filter Tests |
| 45 | + |
| 46 | + steps: |
| 47 | + - name: Checkout code |
| 48 | + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 |
| 49 | + |
| 50 | + - name: Set up Python |
| 51 | + uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4 |
| 52 | + with: |
| 53 | + python-version: '3.11' |
| 54 | + |
| 55 | + - name: Install dependencies |
| 56 | + run: | |
| 57 | + python -m pip install --upgrade pip |
| 58 | + pip install pytest |
| 59 | +
|
| 60 | + - name: Run custom filter tests |
| 61 | + run: | |
| 62 | + cd filter_plugins |
| 63 | + python -m pytest test_custom_filters.py -v |
| 64 | +
|
| 65 | + secrets-scan: |
| 66 | + runs-on: ubuntu-latest |
| 67 | + name: Secrets Scanning |
| 68 | + |
| 69 | + steps: |
| 70 | + - name: Checkout code |
| 71 | + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 |
| 72 | + with: |
| 73 | + |
| 74 | + fetch-depth: 0 |
0 commit comments