-
Notifications
You must be signed in to change notification settings - Fork 13
45 lines (38 loc) · 1.29 KB
/
ansible.yml
File metadata and controls
45 lines (38 loc) · 1.29 KB
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
name: Ansible
on:
push:
branches:
- 'main'
pull_request:
paths:
- 'ansible/**'
- 'requirements.txt'
- '.github/workflows/ansible.yml'
jobs:
build:
runs-on: ubuntu-latest
steps:
# Important: This sets up your GITHUB_WORKSPACE environment variable
- uses: actions/checkout@v2
- name: Install all requirements
run: |
python3 -m pip install --upgrade -r requirements.txt
# 25.1.3 is the newest version that support ansible-core 2.16.8 we are using right now
python3 -m pip install ansible-lint==25.1.3
ansible-galaxy install -r requirements.yml
- name: Run ansible static tests
run: |
make -n static-ansible
make SHELL='sh -x' static-ansible
- name: Get all changed Ansible files
id: changed-markdown-files
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46
with:
files: |
ansible/playbooks/
- name: Run ansible-lint only on changed files
if: steps.changed-markdown-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }}
run: |
ansible-lint --offline ${ALL_CHANGED_FILES}