Feature: Introduce variables database_host and database_password #689
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Automatic CI for TFE Modules | |
on: | |
pull_request: | |
branches: | |
- main | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
terraform_format: | |
name: Run terraform fmt | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
persist-credentials: false | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v1 | |
with: | |
terraform_version: 0.14.7 | |
- name: Format all .tf files recursively | |
run: | | |
terraform fmt -check -diff -recursive ${{ github.workspace }} | |
terraform_lint: | |
name: Run terraform-lint | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
persist-credentials: false | |
- name: Setup Terraform Lint | |
uses: terraform-linters/setup-tflint@19a52fbac37dacb22a09518e4ef6ee234f2d4987 # v4.0.0 | |
with: | |
tflint_version: v0.26.0 | |
- name: Lint root module | |
run: | | |
tflint --config ${{ github.workspace }}/.tflint.hcl ${{ github.workspace }} | |
- name: Lint fixtures directory in a loop | |
run: | | |
for m in $(ls -1d fixtures/*/) | |
do | |
tflint \ | |
--config ${{ github.workspace }}/.tflint.hcl \ | |
${{ github.workspace }}/${m} | |
done | |
- name: Lint modules directory in a loop | |
run: | | |
for m in $(ls -1d modules/*/) | |
do | |
tflint \ | |
--config ${{ github.workspace }}/.tflint.hcl \ | |
${{ github.workspace }}/${m} | |
done | |
- name: Lint tests directory in a loop | |
run: | | |
for m in $(ls -1d tests/*/) | |
do | |
tflint \ | |
--config ${{ github.workspace }}/.tflint.hcl \ | |
${{ github.workspace }}/${m} | |
done | |
- name: Lint examples directory in a loop | |
run: | | |
for m in $(ls -1d examples/*/) | |
do | |
tflint \ | |
--config ${{ github.workspace }}/.tflint.hcl \ | |
${{ github.workspace }}/${m} | |
done |