diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml new file mode 100644 index 0000000..7608b0b --- /dev/null +++ b/.github/workflows/fmt.yml @@ -0,0 +1,24 @@ +name: fmt + +on: + pull_request: + branches: [ main ] + +jobs: + fmt: + runs-on: ubuntu-latest + + steps: + - name: checkout code + uses: actions/checkout@v4 + + - name: setup terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: ${{ vars.TERRAFORM_VERSION }} + + - name: terraform init + run: terraform init -backend=false + + - name: terraform fmt check + run: terraform fmt --recursive --check diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..a6e25a4 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,24 @@ +name: validate + +on: + pull_request: + branches: [ main ] + +jobs: + validate: + runs-on: ubuntu-latest + + steps: + - name: checkout code + uses: actions/checkout@v4 + + - name: setup terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: ${{ vars.TERRAFORM_VERSION }} + + - name: terraform init + run: terraform init -backend=false + + - name: terraform validate + run: terraform validate