Skip to content

ER-790: Azure Refinements #144

ER-790: Azure Refinements

ER-790: Azure Refinements #144

name: 'Terraform Unit Tests'
on:
pull_request:
branches:
- main
paths:
- 'terraform-azure/**'
- '!terraform-azure/**.md'
defaults:
run:
working-directory: ./terraform-azure
jobs:
terraform-unit-tests:
name: 'Run Tests'
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3
# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
# Initialise a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
run: terraform init -backend=false
# Validate terraform files
- name: Terraform Validate
run: terraform validate
# Checks that all Terraform configuration files adhere to a canonical format
# Will fail the build if not
- name: Terraform Format
run: terraform fmt -check -recursive
# Perform a security scan of the terraform code using checkov
- name: Run Checkov action
id: checkov
uses: bridgecrewio/checkov-action@master
with:
framework: terraform