Skip to content

Commit

Permalink
move dflook workflow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
swibrow committed Feb 20, 2024
1 parent b8e7085 commit 46e8a57
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 38 deletions.
6 changes: 6 additions & 0 deletions .github/.env.sandbox
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AWS_OIDC_ROLE_ARN=arn:aws:iam::911453050078:role/cicd-iac
AWS_REGION=eu-central-1

TF_BACKEND_CONFIGS="bucket=tf-state-911453050078 key=sandbox.tfstate workspace_key_prefix=github-workflows"
TF_DIR=tests/terraform/s3
TF_VAR_FILES=tests/terraform/s3/environment/sandbox.tfvars
17 changes: 17 additions & 0 deletions .github/workflows/_test-tf-dflook-apply.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/_test-tf-dflook-apply.yaml'
- '.github/workflows/tf-dflook-apply.yaml'
- 'tests/terraform/**'
push:
branches:
- main

jobs:
test_tf_dflook_apply:
uses: ./.github/workflows/tf-dflook-apply.yaml
with:
environment: sandbox
1 change: 0 additions & 1 deletion .github/workflows/_test-tf-dflook-feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- '.github/workflows/_test-tf-dflook-feature.yaml'
- '.github/workflows/tf-dflook-feature.yaml'
- 'tests/terraform/**'

push:
branches:
- main
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/_test-tf-dflook-plan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/_test-tf-dflook-plan.yaml'
- '.github/workflows/tf-dflook-plan.yaml'
- 'tests/terraform/**'
push:
branches:
- main

jobs:
test_tf_dflook_plan:
uses: ./.github/workflows/tf-dflook-plan.yaml
with:
environment: sandbox
37 changes: 0 additions & 37 deletions .github/workflows/_test-workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,40 +48,3 @@ jobs:
image_name: test-docker-build-push
docker_context: tests/docker
docker_push: false

# Enable once we have access to dai sandbox account
# test_docker_push_ecr:
# uses: ./.github/workflows/docker-push-ecr.yaml
# with:
# aws_account_id: 123456789012
# aws_region: us-east-1
# aws_role_name: cicd-iac
# image_name: test-docker-build
# image_tag: ${{ github.ref_head }}

test_terraform_dflook_plan:
uses: ./.github/workflows/tf-dflook-plan.yaml
with:
aws_account_id: ${{ vars.aws_account_id }}
aws_region: ${{ vars.aws_region }}
aws_role_name: ${{ vars.aws_role_name }}
environment: sandbox
tf_backend_configs: |
bucket=tf-state-911453050078
key=github-workflows/tf-dflook
tf_dir: tests/terraform/s3
tf_var_files: tests/terraform/s3/environment/sandbox.tfvars

test_terraform_dflook_apply:
needs: test_terraform_dflook_plan
uses: ./.github/workflows/tf-dflook-apply.yaml
with:
aws_account_id: ${{ vars.aws_account_id }}
aws_region: ${{ vars.aws_region }}
aws_role_name: ${{ vars.aws_role_name }}
environment: sandbox
tf_backend_configs: |
bucket=tf-state-911453050078
key=github-workflows/tf-dflook
tf_dir: tests/terraform/s3
tf_var_files: tests/terraform/s3/environment/sandbox.tfvars

0 comments on commit 46e8a57

Please sign in to comment.