-
Notifications
You must be signed in to change notification settings - Fork 16
48 lines (40 loc) · 1.43 KB
/
check_generated_ansible.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
# Ensure Ansible 'default' files match the Python entrypoint
name: Ansible defaults match
on:
# Triggers the workflow on push or pull request events but only for the main branch
pull_request:
branches: [main]
push:
branches: [main]
schedule:
- cron: '0 */8 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/steps/prepare_minimal_ubuntu_image
- name: "Ensure that Ansible 'default' files match the Python entrypoint"
run: |
./run_toolbox.py repo generate_ansible_default_settings
- name: Show the difference between the commited files and the regenerated Ansible files
run: |
git diff
- name: "Ensure that there is no missing Ansible documentation"
run: |
! grep 'Missing documentation' . -R --include 'config.yml'
- name: Fail the test if there is a mismatch between the roles defaults and the Python entrypoints
run: |
changes=$(git diff | wc -l)
if [ "$changes" -ne "0" ]; then
echo "
There is a mismatch between the roles
defaults and the Python entrypoints.
Make sure you run:
./run_toolbox.py repo generate_ansible_default_settings
When making changes to the Python entrypoints.
"
exit 1
fi