Add CI to validate terraform
This commit is contained in:
parent
a3cc0f7849
commit
418c813ddb
3 changed files with 22 additions and 0 deletions
17
.github/workflows/terraform.yml
vendored
Normal file
17
.github/workflows/terraform.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
name: Terraform
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Install terraform
|
||||||
|
- uses: marocchino/setup-terraform@v1
|
||||||
|
with:
|
||||||
|
version: "0.12.20"
|
||||||
|
- name: Initialize Terraform
|
||||||
|
run: terraform init
|
||||||
|
- name: Lint
|
||||||
|
run: ./scripts/terraform-lint.sh
|
|
@ -1,6 +1,7 @@
|
||||||
# Infrastructure
|
# Infrastructure
|
||||||
|
|
||||||
![Ansible Status](https://github.com/realorangeone/infrastructure/workflows/Ansible/badge.svg)
|
![Ansible Status](https://github.com/realorangeone/infrastructure/workflows/Ansible/badge.svg)
|
||||||
|
![Terraform Status](https://github.com/realorangeone/infrastructure/workflows/Terraform/badge.svg)
|
||||||
![Generic Linting](https://github.com/realorangeone/infrastructure/workflows/Lint/badge.svg)
|
![Generic Linting](https://github.com/realorangeone/infrastructure/workflows/Lint/badge.svg)
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
|
@ -4,4 +4,8 @@ set -e
|
||||||
|
|
||||||
cd terraform/
|
cd terraform/
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
terraform validate
|
||||||
|
|
||||||
terraform fmt -check -recursive
|
terraform fmt -check -recursive
|
||||||
|
|
Loading…
Reference in a new issue