Skip to content

Commit

Permalink
Add testing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanvuong2021 committed Jan 25, 2024
1 parent 0b9a6d4 commit 8c45840
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 38 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/reporting-v2-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@ name: Reporting V2 Testing
on:
pull_request:

permissions:
id-token: write

jobs:
push-images:
uses: ./.github/workflows/push-images.yml
publish-images:
uses: ./.github/workflows/push-images.yml

terraform:
uses: ./.github/workflows/terraform-cmms.yml
secrets: inherit
with:
environment: ${{ inputs.environment }}
apply: ${{ inputs.apply }}

update-reporting-v2:
uses: ./.github/workflows/configure-reporting-v2.yml
needs: [ publish-images, terraform ]
with:
image-tag: ${{ needs.publish-images.outputs.image-tag }}
environment: ${{ inputs.environment }}
apply: ${{ inputs.apply }}
36 changes: 0 additions & 36 deletions .github/workflows/terraform-cmms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
GCLOUD_MODULE_PATH: src/main/terraform/gcloud/cmms
GCLOUD_REGION: ${{ vars.GCLOUD_REGION }}
GCLOUD_ZONE: ${{ vars.GCLOUD_ZONE }}
AWS_MODULE_PATH: src/main/terraform/aws/cmms

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -96,38 +95,3 @@ jobs:
if: ${{ inputs.apply }}
working-directory: ${{ env.GCLOUD_MODULE_PATH }}
run: terraform apply -input=false tfplan

# Authenticate to AWS Cloud. This will export some environment
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: ${{ vars.AWS_GHA_ROLE }}
role-session-name: GitHubAction

- name: terraform init - aws
env:
TF_STORAGE_BUCKET: ${{ vars.AWS_TF_STORAGE_BUCKET }}
working-directory: ${{ env.AWS_MODULE_PATH }}
run: >
terraform init
-input=false
-lockfile=readonly
-backend-config="bucket=$TF_STORAGE_BUCKET"
-backend-config="region=$AWS_REGION"
- name: terraform plan - aws
env:
POSTGRES_INSTANCE: ${{ vars.POSTGRES_INSTANCE }}
working-directory: ${{ env.AWS_MODULE_PATH }}
run: >
terraform plan
-input=false
-var="aws_region=$AWS_REGION"
-var="postgres_instance_name=$POSTGRES_INSTANCE"
-out=tfplan
- name: terraform apply - aws
if: ${{ inputs.apply }}
working-directory: ${{ env.AWS_MODULE_PATH }}
run: terraform apply -input=false tfplan

0 comments on commit 8c45840

Please sign in to comment.