From 9748105907d4cb139ec6e3933714f39ce6e0af75 Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Thu, 25 Apr 2024 10:38:22 -0400 Subject: [PATCH] add a delay test --- .github/workflows/data/delay/main.tf | 11 ++++++++++ .github/workflows/setup-terraform.yml | 31 ++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/data/delay/main.tf diff --git a/.github/workflows/data/delay/main.tf b/.github/workflows/data/delay/main.tf new file mode 100644 index 0000000..cbf7efb --- /dev/null +++ b/.github/workflows/data/delay/main.tf @@ -0,0 +1,11 @@ +resource "null_resource" "previous" {} + +resource "time_sleep" "wait_30_seconds" { + depends_on = [null_resource.previous] + + create_duration = "30s" +} + +resource "null_resource" "next" { + depends_on = [time_sleep.wait_30_seconds] +} diff --git a/.github/workflows/setup-terraform.yml b/.github/workflows/setup-terraform.yml index ce56929..96af123 100644 --- a/.github/workflows/setup-terraform.yml +++ b/.github/workflows/setup-terraform.yml @@ -304,7 +304,6 @@ jobs: id: plan run: terraform plan - terraform-stdout-wrapper: name: 'Terraform STDOUT' runs-on: ${{ matrix.os }} @@ -370,3 +369,33 @@ jobs: - name: Terraform Output to JQ id: output run: terraform output -json | jq '.pet.value' + + # This test has an artificial delay for testing the streaming of STDOUT + terraform-wrapper-delayed-apply: + name: 'Terraform Delayed Apply' + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + defaults: + run: + shell: bash + working-directory: ./.github/workflows/data/delay + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup Terraform + uses: ./ + with: + terraform_wrapper: true + + - name: Terraform Init + run: terraform init + + - name: Terraform Format + run: terraform fmt -check + + - name: Terraform Apply + id: apply + run: terraform apply -auto-approve