-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (51 loc) · 1.62 KB
/
main.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
53
54
55
56
57
---
name: Linter and test the project
env:
ANSIBLE_INVENTORY_UNPARSED_WARNING: 'False'
ANSIBLE_LOCALHOST_WARNING: 'False'
on: ['push']
jobs:
lint:
runs-on: ubuntu-latest
container:
image: quay.io/mmul/kpa
options: --user root
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Markdown files check
run: mdl $(find . -name *.md)
- name: YAML files check
run: yamllint $(find . -name *.yml -or -name *.yaml)
- name: Ansible Linter check
run: ansible-lint tests/tfs_generator.yml
- name: Ansible syntax check
run: ansible-playbook --syntax-check tests/tfs_generator.yml
test:
runs-on: ubuntu-latest
needs: lint
container:
image: quay.io/mmul/kpa
options: --user root
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Ansible effective execution (should produce tf/*.tf files)
run: ansible-playbook -i tests/inventory tests/tfs_generator.yml
- name: Check tf/*.tf files existence
run: for tf in cloud_init.tf mylabvmsgroup.vms.tf networks.tf pools.tf
provider.tf volumes.tf; do
echo "Checking tests/tfs/${tf}";
test -f tests/terraform/${tf};
done
trigger_galaxy_import:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Release Ansible Role to Galaxy
uses: hspaans/ansible-galaxy-action@v1
with:
api_key: ${{ secrets.GALAXY_API_KEY }}