Skip to content

Commit

Permalink
Add the Github workflow for the Terraform checks
Browse files Browse the repository at this point in the history
Signed-off-by: gatici <gulsum.atici@canonical.com>
  • Loading branch information
gatici committed Feb 5, 2024
1 parent 8f7e587 commit d0d7643
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
lint-report:
uses: canonical/sdcore-github-workflows/.github/workflows/lint-report.yaml@main

terraform-check:
uses: ./.github/workflows/terraform.yaml

static-analysis:
uses: canonical/sdcore-github-workflows/.github/workflows/static-analysis.yaml@main

Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check the Terraform Module

on:
workflow_call:

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
2 changes: 1 addition & 1 deletion terraform/terraform.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Canonical Ltd.
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

terraform {
Expand Down

0 comments on commit d0d7643

Please sign in to comment.