-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (58 loc) · 1.93 KB
/
static-analysis.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Static analysis
on:
push:
pull_request:
types:
- opened
- synchronize
jobs:
terraform_lint:
name: Terraform lint
runs-on: ubuntu-22.04
# Exclude in-repo PRs from running this job
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
steps:
- name: 📥 Checkout source
uses: actions/checkout@v4
- name: 🧰 Setup Terraform CLI
uses: hashicorp/setup-terraform@v3
env:
# renovate: datasource=docker depName=hashicorp/terraform versioning=docker
TERRAFORM_VERSION: 1.8.5
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_wrapper: false
- name: ⚙️ Initialize Terraform
run: terraform init
- name: 🔍 Terraform files format check
run: terraform fmt -check
- name: 🔍 Validate Terraform files
run: terraform validate
ansible_lint:
name: Ansible lint
runs-on: ubuntu-22.04
# Exclude in-repo PRs from running this job
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
steps:
- name: 📥 Checkout source
uses: actions/checkout@v4
- name: 🧰 Set up Poetry
env:
# renovate: datasource=pypi depName=poetry
POETRY_VERSION: 1.8.3
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: 🧰 Set up Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
cache: poetry
- name: ⚙️ Create Ansible Vault password file
env:
ANSIBLE_VAULT_PASSWORD: ${{ secrets.ANSIBLE_VAULT_PASSWORD }}
run: |
mkdir secrets
echo "$ANSIBLE_VAULT_PASSWORD" > secrets/vault_password
- name: 🧰 Install Poetry dependencies
run: poetry install
- name: 🔍 Run ansible-lint
run: poetry run ansible-lint .