-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(security-keys): Add localstack to github action for testing
- Loading branch information
1 parent
27b6185
commit d38817f
Showing
4 changed files
with
262 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,192 +14,215 @@ on: | |
- security/us-east-1/security-keys/** | ||
- shared/us-east-1/security-keys/** | ||
- shared/us-east-2/security-keys/** | ||
|
||
jobs: | ||
apps-devstg: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: 1.7.0 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
us-east-1: | ||
- 'apps-devstg/us-east-1/security-keys/**' | ||
us-east-2: | ||
- 'apps-devstg/us-east-2/security-keys/**' | ||
- name: Terraform Init on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: apps-devstg/us-east-1/security-keys | ||
run: terraform init | ||
- name: Run Unit Test on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: apps-devstg/us-east-1/security-keys | ||
run: | | ||
terraform test | ||
- name: Terraform Init on us-east-2 | ||
if: steps.filter.outputs.us-east-2 == 'true' | ||
working-directory: apps-devstg/us-east-2/security-keys | ||
run: terraform init | ||
- name: Run Unit Test on us-east-2 | ||
if: steps.filter.outputs.us-east-2 == 'true' | ||
working-directory: apps-devstg/us-east-2/security-keys | ||
run: | | ||
terraform test | ||
apps-prd: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: 1.7.0 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
us-east-1: | ||
- 'apps-prd/us-east-1/security-keys/**' | ||
- name: Terraform Init on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: apps-prd/us-east-1/security-keys | ||
run: terraform init | ||
- name: Run Unit Test on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: apps-prd/us-east-1/security-keys | ||
run: | | ||
terraform test | ||
data-science: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: hashicorp/setup-terraform@v3 | ||
- uses: LocalStack/[email protected] | ||
with: | ||
terraform_version: 1.7.0 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
us-east-1: | ||
- 'data-science/us-east-1/security-keys/**' | ||
- name: Terraform Init on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: data-science/us-east-1/security-keys | ||
run: terraform init | ||
- name: Run Unit Test on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: data-science/us-east-1/security-keys | ||
image-tag: "3.7.2" | ||
install-awslocal: true | ||
- name: Configure AWS Credentials | ||
run: | | ||
terraform test | ||
management: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: 1.7.0 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
us-east-1: | ||
- 'management/us-east-1/security-keys/**' | ||
- name: Terraform Init on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: management/us-east-1/security-keys | ||
run: terraform init | ||
- name: Run Unit Test on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: management/us-east-1/security-keys | ||
awslocal configure set aws_access_key_id fake --profile bb-security-devops | ||
awslocal configure set aws_secret_access_key fake --profile bb-security-devops | ||
awslocal configure set region us-east-1 --profile bb-security-devops | ||
awslocal configure set endpoint_url http://localhost:4566 --profile bb-security-devops | ||
- name: Create S3 Buckets | ||
run: | | ||
terraform test | ||
network: | ||
runs-on: ubuntu-latest | ||
steps: | ||
awslocal s3 mb s3://security --region us-east-1 | ||
- uses: actions/checkout@v4 | ||
- uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: 1.7.0 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
us-east-1: | ||
- 'network/us-east-1/security-keys/**' | ||
us-east-2: | ||
- 'network/us-east-2/security-keys/**' | ||
- name: Terraform Init on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: network/us-east-1/security-keys | ||
run: terraform init | ||
- name: Run Unit Test on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: network/us-east-1/security-keys | ||
- name: Copy Terraform State File for testing to S3 Bucket | ||
run: | | ||
terraform test | ||
- name: Terraform Init on us-east-2 | ||
if: steps.filter.outputs.us-east-2 == 'true' | ||
working-directory: network/us-east-2/security-keys | ||
run: terraform init | ||
- name: Run Unit Test on us-east-2 | ||
if: steps.filter.outputs.us-east-2 == 'true' | ||
working-directory: network/us-east-2/security-keys | ||
run: | | ||
terraform test | ||
security: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
awslocal s3 cp apps-devstg/us-east-1/security-keys/tests/terraform.tfstate-test s3://security/identities/terraform.tfstate | ||
- uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: 1.7.0 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
us-east-1: | ||
- 'security/us-east-1/security-keys/**' | ||
- name: Terraform Init on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: security/us-east-1/security-keys | ||
run: terraform init | ||
- name: Run Unit Test on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: security/us-east-1/security-keys | ||
- name: Install tflocal | ||
run: | | ||
terraform test | ||
shared: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: 1.7.0 | ||
pip install terraform-local | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
us-east-1: | ||
- 'shared/us-east-1/security-keys/**' | ||
- 'apps-devstg/us-east-1/security-keys/**' | ||
us-east-2: | ||
- 'shared/us-east-2/security-keys/**' | ||
- 'apps-devstg/us-east-2/security-keys/**' | ||
- name: Terraform Init on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: shared/us-east-1/security-keys | ||
run: terraform init | ||
working-directory: apps-devstg/us-east-1/security-keys | ||
run: tflocal init | ||
- name: Run Unit Test on us-east-1 | ||
if: steps.filter.outputs.us-east-1 == 'true' | ||
working-directory: shared/us-east-1/security-keys | ||
run: | | ||
terraform test | ||
- name: Terraform Init on us-east-2 | ||
if: steps.filter.outputs.us-east-2 == 'true' | ||
working-directory: shared/us-east-2/security-keys | ||
run: terraform init | ||
- name: Run Unit Test on us-east-2 | ||
if: steps.filter.outputs.us-east-2 == 'true' | ||
working-directory: shared/us-east-2/security-keys | ||
working-directory: apps-devstg/us-east-1/security-keys | ||
env: | ||
AWS_DEFAULT_REGION: us-east-1 | ||
AWS_ACCESS_KEY_ID: fake | ||
AWS_SECRET_ACCESS_KEY: fake | ||
run: | | ||
terraform test | ||
cp ../../../config/common.tfvars.example ../../../config/common.tfvars | ||
tflocal test -var-file=../../../config/common.tfvars -var-file=../../config/account.tfvars -var-file=../../config/backend.tfvars | ||
#- name: Terraform Init on us-east-2 | ||
# if: steps.filter.outputs.us-east-2 == 'true' | ||
# working-directory: apps-devstg/us-east-2/security-keys | ||
# run: terraform init | ||
#- name: Run Unit Test on us-east-2 | ||
# if: steps.filter.outputs.us-east-2 == 'true' | ||
# working-directory: apps-devstg/us-east-2/security-keys | ||
# run: | | ||
# terraform test | ||
# apps-prd: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: hashicorp/setup-terraform@v3 | ||
# with: | ||
# terraform_version: 1.7.0 | ||
# - uses: dorny/paths-filter@v3 | ||
# id: filter | ||
# with: | ||
# filters: | | ||
# us-east-1: | ||
# - 'apps-prd/us-east-1/security-keys/**' | ||
# - name: Terraform Init on us-east-1 | ||
# if: steps.filter.outputs.us-east-1 == 'true' | ||
# working-directory: apps-prd/us-east-1/security-keys | ||
# run: terraform init | ||
# - name: Run Unit Test on us-east-1 | ||
# if: steps.filter.outputs.us-east-1 == 'true' | ||
# working-directory: apps-prd/us-east-1/security-keys | ||
# run: | | ||
# terraform test | ||
# data-science: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: hashicorp/setup-terraform@v3 | ||
# with: | ||
# terraform_version: 1.7.0 | ||
# - uses: dorny/paths-filter@v3 | ||
# id: filter | ||
# with: | ||
# filters: | | ||
# us-east-1: | ||
# - 'data-science/us-east-1/security-keys/**' | ||
# - name: Terraform Init on us-east-1 | ||
# if: steps.filter.outputs.us-east-1 == 'true' | ||
# working-directory: data-science/us-east-1/security-keys | ||
# run: terraform init | ||
# - name: Run Unit Test on us-east-1 | ||
# if: steps.filter.outputs.us-east-1 == 'true' | ||
# working-directory: data-science/us-east-1/security-keys | ||
# run: | | ||
# terraform test | ||
# management: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: hashicorp/setup-terraform@v3 | ||
# with: | ||
# terraform_version: 1.7.0 | ||
# - uses: dorny/paths-filter@v3 | ||
# id: filter | ||
# with: | ||
# filters: | | ||
# us-east-1: | ||
# - 'management/us-east-1/security-keys/**' | ||
# - name: Terraform Init on us-east-1 | ||
# if: steps.filter.outputs.us-east-1 == 'true' | ||
# working-directory: management/us-east-1/security-keys | ||
# run: terraform init | ||
# - name: Run Unit Test on us-east-1 | ||
# if: steps.filter.outputs.us-east-1 == 'true' | ||
# working-directory: management/us-east-1/security-keys | ||
# run: | | ||
# terraform test | ||
# network: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: hashicorp/setup-terraform@v3 | ||
# with: | ||
# terraform_version: 1.7.0 | ||
# - uses: dorny/paths-filter@v3 | ||
# id: filter | ||
# with: | ||
# filters: | | ||
# us-east-1: | ||
# - 'network/us-east-1/security-keys/**' | ||
# us-east-2: | ||
# - 'network/us-east-2/security-keys/**' | ||
# - name: Terraform Init on us-east-1 | ||
# if: steps.filter.outputs.us-east-1 == 'true' | ||
# working-directory: network/us-east-1/security-keys | ||
# run: terraform init | ||
# - name: Run Unit Test on us-east-1 | ||
# if: steps.filter.outputs.us-east-1 == 'true' | ||
# working-directory: network/us-east-1/security-keys | ||
# run: | | ||
# terraform test | ||
# - name: Terraform Init on us-east-2 | ||
# if: steps.filter.outputs.us-east-2 == 'true' | ||
# working-directory: network/us-east-2/security-keys | ||
# run: terraform init | ||
# - name: Run Unit Test on us-east-2 | ||
# if: steps.filter.outputs.us-east-2 == 'true' | ||
# working-directory: network/us-east-2/security-keys | ||
# run: | | ||
# terraform test | ||
# security: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: hashicorp/setup-terraform@v3 | ||
# with: | ||
# terraform_version: 1.7.0 | ||
# - uses: dorny/paths-filter@v3 | ||
# id: filter | ||
# with: | ||
# filters: | | ||
# us-east-1: | ||
# - 'security/us-east-1/security-keys/**' | ||
# - name: Terraform Init on us-east-1 | ||
# if: steps.filter.outputs.us-east-1 == 'true' | ||
# working-directory: security/us-east-1/security-keys | ||
# run: terraform init | ||
# - name: Run Unit Test on us-east-1 | ||
# if: steps.filter.outputs.us-east-1 == 'true' | ||
# working-directory: security/us-east-1/security-keys | ||
# run: | | ||
# terraform test | ||
# shared: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: hashicorp/setup-terraform@v3 | ||
# with: | ||
# terraform_version: 1.7.0 | ||
# - uses: dorny/paths-filter@v3 | ||
# id: filter | ||
# with: | ||
# filters: | | ||
# us-east-1: | ||
# - 'shared/us-east-1/security-keys/**' | ||
# us-east-2: | ||
# - 'shared/us-east-2/security-keys/**' | ||
# - name: Terraform Init on us-east-1 | ||
# if: steps.filter.outputs.us-east-1 == 'true' | ||
# working-directory: shared/us-east-1/security-keys | ||
# run: terraform init | ||
# - name: Run Unit Test on us-east-1 | ||
# if: steps.filter.outputs.us-east-1 == 'true' | ||
# working-directory: shared/us-east-1/security-keys | ||
# run: | | ||
# terraform test | ||
# - name: Terraform Init on us-east-2 | ||
# if: steps.filter.outputs.us-east-2 == 'true' | ||
# working-directory: shared/us-east-2/security-keys | ||
# run: terraform init | ||
# - name: Run Unit Test on us-east-2 | ||
# if: steps.filter.outputs.us-east-2 == 'true' | ||
# working-directory: shared/us-east-2/security-keys | ||
# run: | | ||
# terraform test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.