From a572edb7d896de36902ccd4fb97ccc91707b4d14 Mon Sep 17 00:00:00 2001 From: gatici Date: Mon, 5 Feb 2024 15:35:05 +0300 Subject: [PATCH] Add the Github workflow for the Terraform checks Signed-off-by: gatici --- .github/workflows/terraform.yaml | 30 ++++++++++++++++++++++++++++++ terraform/terraform.tf | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/terraform.yaml diff --git a/.github/workflows/terraform.yaml b/.github/workflows/terraform.yaml new file mode 100644 index 0000000..f161c71 --- /dev/null +++ b/.github/workflows/terraform.yaml @@ -0,0 +1,30 @@ +name: Check the Terraform Module + +on: + pull_request: + paths: + - '**.tf' + +jobs: + build: + name: Terraform Checks and Plans + runs-on: ubuntu-latest + steps: + - name: Checkout the repository to the runner + uses: actions/checkout@v3 + + - name: HashiCorp - Setup Terraform + uses: hashicorp/setup-terraform@v3 + + - name: Terraform Format + id: fmt + run: terraform fmt -recursive -check + continue-on-error: true + + - name: Terraform Init + id: init + run: terraform init + + - name: Terraform Validate + id: validate + run: terraform validate -no-color \ No newline at end of file diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 545a7bb..4f60bb4 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -1,4 +1,4 @@ -# Copyright 2023 Canonical Ltd. +# Copyright 2024 Canonical Ltd. # See LICENSE file for licensing details. terraform {