Repository navigation
70 lines (55 loc) · 1.68 KB
/
Copy pathci.yml
File metadata and controls
70 lines (55 loc) · 1.68 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
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
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
terraform:
name: Terraform fmt, validate, tflint
runs-on: ubuntu-latest
defaults:
run:
working-directory: terraform/environments/lab
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: "~> 1.15"
terraform_wrapper: false
- name: Create throwaway SSH key (the lab reads ~/.ssh/lab_ed25519.pub at plan time)
working-directory: .
run: |
mkdir -p ~/.ssh
ssh-keygen -q -t ed25519 -N '' -f ~/.ssh/lab_ed25519 -C ci-validate-only
- name: terraform fmt
run: terraform fmt -check -recursive -diff
- name: terraform init (no backend)
run: terraform init -backend=false -input=false
- name: terraform validate
run: terraform validate
- uses: terraform-linters/setup-tflint@v4
with:
tflint_version: latest
- name: tflint
working-directory: .
run: |
tflint --init
tflint --config="$PWD/.tflint.hcl" --chdir=terraform/environments/lab
ansible:
name: ansible-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install ansible-lint
run: pip install ansible-lint ansible-core
- name: Install collections
working-directory: ansible
run: ansible-galaxy collection install -r collections/requirements.yml
- name: ansible-lint
working-directory: ansible
run: ansible-lint playbooks roles