Skip to content

Commit

Permalink
Spin Test environment with Terraform
Browse files Browse the repository at this point in the history
Signed-off-by: Liora Milbaum <[email protected]>
  • Loading branch information
lmilbaum committed Apr 2, 2024
1 parent fc58ca4 commit c5a6eb1
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions .github/workflows/testing-framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,58 @@ on:

workflow_dispatch:

pull_request: ## temporary for debugging development purposes
branches:
- main

env:
REGISTRY: ghcr.io

jobs:
build-and-push-image:
spin-test-environment:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
path: main

- name: Checkout terraform module
id: checkout-module
uses: actions/[email protected]
with:
repository: containers/terraform-test-environment-module
path: terraform-test-environment-module
ref: 'main'

- uses: hashicorp/[email protected]
- name: Setup Terraform
uses: hashicorp/[email protected]
with:
terraform_version: "1.7.5"
terraform_wrapper: false

- run: terraform init
id: init
working-directory: terraform-test-environment-module

- name: Plan
run: terraform plan
working-directory: terraform-test-environment-module
env:
TF_VAR_aws_region: "eu-west-2"
TF_VAR_aws_instance_type: "t3.large"
TF_VAR_aws_ami_owners: '["125523088429"]'
TF_VAR_aws_ami_name: '["Fedora-Cloud-Base-*"]'
TF_VAR_aws_volume_size: 100
TF_VAR_aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
TF_VAR_aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

# - name: Spin Test Environment
# id: apply
# run: TF_LOG=DEBUG terraform apply -auto-approve -lock=false
# working-directory: terraform-test-environment-module

# - name: Destroy Test Environment
# id: destroy
# if: always()
# run: TF_LOG=DEBUG terraform destroy -auto-approve -lock=false
# working-directory: terraform-test-environment-module

0 comments on commit c5a6eb1

Please sign in to comment.