-
Notifications
You must be signed in to change notification settings - Fork 85
47 lines (39 loc) · 1.05 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
name: Lint
on:
push:
branches: [main]
paths:
- "**.md"
- "**.tf"
- ".github/workflows/lint.yml"
pull_request:
branches: [main]
paths:
- "**.md"
- "**.tf"
- ".github/workflows/lint.yml"
env:
TF_PLUGIN_CACHE_DIR: "$HOME/.terraform.d/plugin-cache"
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: "Check out"
uses: actions/checkout@v2
- name: Lint markdown
uses: nosborn/[email protected]
with:
files: .
config_file: .markdownlint.yaml
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.1.7
- name: Terraform fmt check
id: fmt
run: terraform fmt -check
- name: Make tf-plugin-cache dir
run: mkdir -p ${TF_PLUGIN_CACHE_DIR}
- name: Terraform init&&validate
run: find . -name '*.tf' -print | xargs dirname | uniq | time xargs -n 1 -I{} sh -c 'terraform -chdir={} init && terraform -chdir={} validate'