From accd49001944a225f946271943332ae75adee562 Mon Sep 17 00:00:00 2001 From: Julian Nonino Date: Wed, 20 Sep 2023 11:21:39 +0100 Subject: [PATCH] Update pipeline.yml --- .github/workflows/pipeline.yml | 44 +++++++--------------------------- 1 file changed, 9 insertions(+), 35 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 3541d65..9e3b13d 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -23,24 +23,7 @@ jobs: - name: Terraform Format Check run: terraform fmt -check -recursive -diff - validate: - runs-on: ubuntu-latest - container: hashicorp/terraform - strategy: - matrix: { - dir: ['examples/test'] - } - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Terraform Init - run: terraform init -upgrade - working-directory: ${{ matrix.dir }} - - name: Terraform Validate - run: terraform validate - working-directory: ${{ matrix.dir }} - - mock-plan: + validations: runs-on: ubuntu-latest container: hashicorp/terraform strategy: @@ -60,24 +43,15 @@ jobs: - name: Terraform Init run: terraform init -upgrade working-directory: ${{ matrix.dir }} + - name: Terraform Validate + run: terraform validate + working-directory: ${{ matrix.dir }} - name: Terraform Plan (Mock) run: terraform plan working-directory: ${{ matrix.dir }} - - infracost: - runs-on: ubuntu-latest - name: Show infracost diff - strategy: - matrix: { - dir: ['examples/test'] - } - steps: - - name: Check out repository - uses: actions/checkout@v4 - - name: Run infracost diff - uses: infracost/infracost-gh-action@master - env: - INFRACOST_API_KEY: ${{ secrets.INFRACOST_API_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Infracost + uses: infracost/actions/setup@v2 with: - path: ${{ matrix.dir }} + api-key: ${{ secrets.INFRACOST_API_KEY }} + - name: Generate Infracost cost estimate + run: infracost breakdown --path ${{ matrix.dir }}