From 8c45840fea46bd885b04e173bfbc7134befc15c3 Mon Sep 17 00:00:00 2001 From: Tristan Vuong Date: Thu, 25 Jan 2024 19:26:17 +0000 Subject: [PATCH] Add testing workflow --- .github/workflows/reporting-v2-testing.yml | 22 +++++++++++-- .github/workflows/terraform-cmms.yml | 36 ---------------------- 2 files changed, 20 insertions(+), 38 deletions(-) diff --git a/.github/workflows/reporting-v2-testing.yml b/.github/workflows/reporting-v2-testing.yml index 4313586a182..383d90ea23a 100644 --- a/.github/workflows/reporting-v2-testing.yml +++ b/.github/workflows/reporting-v2-testing.yml @@ -3,6 +3,24 @@ name: Reporting V2 Testing on: pull_request: +permissions: + id-token: write + jobs: - push-images: - uses: ./.github/workflows/push-images.yml \ No newline at end of file + 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 }} diff --git a/.github/workflows/terraform-cmms.yml b/.github/workflows/terraform-cmms.yml index b9c6ba471eb..74bb4d3c283 100644 --- a/.github/workflows/terraform-cmms.yml +++ b/.github/workflows/terraform-cmms.yml @@ -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 @@ -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