diff --git a/.github/workflows/testing-framework.yaml b/.github/workflows/testing-framework.yaml index a64840b64..cf41d943c 100644 --- a/.github/workflows/testing-framework.yaml +++ b/.github/workflows/testing-framework.yaml @@ -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/checkout@v4.1.1 + with: + path: main + + - name: Checkout terraform module + id: checkout-module + uses: actions/checkout@v4.1.1 + with: + repository: containers/terraform-test-environment-module + path: terraform-test-environment-module + ref: 'main' - - uses: hashicorp/setup-terraform@v3.0.0 + - name: Setup Terraform + uses: hashicorp/setup-terraform@v3.0.0 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