-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (49 loc) · 1.65 KB
/
lint.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
58
59
60
61
name: Lint Provisioning Scripts
on:
push:
branches:
- master
pull_request:
jobs:
lint-terraform:
env:
TERRAFORM_VERSION: "0.14.3"
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
- name: Initialize Terraform
run: terraform init
- name: Validate terraform files
run: terraform validate
- name: Ensure Terraform files follow the official style guides
run: terraform fmt -check -recursive
lint-ansible-playbooks:
env:
ANSIBLE_VERSION: "5.2.0"
PYTHON_VERSION: "3.10.1"
ANSIBLE_LINT_VERSION: "5.3.2"
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Ansible & Ansible lint & dependencies
run: |
python -m pip install --upgrade pip
pip install ansible-lint==${{ env.ANSIBLE_LINT_VERSION }} ansible==${{ env.ANSIBLE_VERSION }}
- name: Install external collections
run: ansible-galaxy collection install -r requirements.yml
- name: Install external roles
run: ansible-galaxy role install -r requirements.yml
- name: Lint Ansible Playbooks
run: |
ansible-playbook minecraft-server-configuration.yml --syntax-check
ansible-lint minecraft-server-configuration.yml --exclude=${HOME}/.ansible/roles/