From a830745cbfc30d9b5c8867605c6f23d83a9d421d Mon Sep 17 00:00:00 2001 From: Paul Schwarzenberger Date: Wed, 20 Mar 2024 09:13:27 +0000 Subject: [PATCH] Terraform test workflow (#84) Terraform test workflow and Terraform validate steps --- .github/workflows/ecdsa_default.yml | 9 ++++++-- .github/workflows/rsa_public_crl.yml | 9 ++++++-- .github/workflows/terraform.yml | 31 ++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/terraform.yml diff --git a/.github/workflows/ecdsa_default.yml b/.github/workflows/ecdsa_default.yml index 6c1f5c5e..df3b906d 100644 --- a/.github/workflows/ecdsa_default.yml +++ b/.github/workflows/ecdsa_default.yml @@ -28,10 +28,15 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Terraform validate - id: fmt + - name: Terraform format run: terraform fmt -check -recursive + - name: Terraform init + run: terraform init -get -backend=false + + - name: Terraform validate + run: terraform validate + secret_scan: name: Secret scan runs-on: ubuntu-latest diff --git a/.github/workflows/rsa_public_crl.yml b/.github/workflows/rsa_public_crl.yml index 2b878343..14c9dde5 100644 --- a/.github/workflows/rsa_public_crl.yml +++ b/.github/workflows/rsa_public_crl.yml @@ -31,10 +31,15 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Terraform validate - id: fmt + - name: Terraform format run: terraform fmt -check -recursive + - name: Terraform init + run: terraform init -get -backend=false + + - name: Terraform validate + run: terraform validate + secret_scan: name: Secret scan runs-on: ubuntu-latest diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml new file mode 100644 index 00000000..4e7136b8 --- /dev/null +++ b/.github/workflows/terraform.yml @@ -0,0 +1,31 @@ +name: Terraform tests +on: + workflow_dispatch: + push: + paths: + - "**/*.tf" + - ".github/workflows/terraform.yml" + +jobs: + terraform_validate: + name: Terraform validate + runs-on: ubuntu-latest + steps: + - name: Terraform setup + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: 1.6.1 + + - name: Checkout + uses: actions/checkout@v4 + + - name: Terraform format + run: terraform fmt -check -recursive + + - name: Terraform init + working-directory: ./examples/default + run: terraform init -get -backend=false + + - name: Terraform validate + working-directory: ./examples/default + run: terraform validate