Skip to content

Commit

Permalink
Added GH workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mikouaj committed Mar 25, 2021
1 parent 987f9f6 commit f0728e7
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Terraform

on:
push:
branches:
- main
pull_request:

jobs:
terraform:
name: Terraform
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
directory: [".", "./example"]
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: ">= 0.13"
- name: Init Terraform
run: terraform init
working-directory: ${{ matrix.directory }}
- name: Validate Terraform configurations
run: terraform validate
working-directory: ${{ matrix.directory }}
- name: Validate Terraform configuration files formatting
run: if ! terraform fmt -list=false -check; then echo "Some terraform files need be formatted, run 'terraform fmt' to fix"; exit 1; fi
working-directory: ${{ matrix.directory }}

0 comments on commit f0728e7

Please sign in to comment.