From 78867b0f99ce33e995f8124cc1b3266de21ac9ea Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Tue, 25 Apr 2023 13:52:30 +0200 Subject: [PATCH] Merge actions --- .github/actions/fabric-tests/action.yml | 5 +++-- .github/workflows/tests.yml | 20 ++++++++------------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/actions/fabric-tests/action.yml b/.github/actions/fabric-tests/action.yml index c3fa70a9..148b93c8 100644 --- a/.github/actions/fabric-tests/action.yml +++ b/.github/actions/fabric-tests/action.yml @@ -41,13 +41,14 @@ runs: - name: Configure provider cache shell: bash run: | - echo 'plugin_cache_dir = "/home/runner/.terraform.d/plugin-cache"' \ + echo 'plugin_cache_dir = "${{ env.TF_PLUGIN_CACHE_DIR }}"' \ | tee -a /home/runner/.terraformrc echo 'disable_checkpoint = true' \ | tee -a /home/runner/.terraformrc mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} - - uses: actions/download-artifact@v3 + - name: Download lockfile + uses: actions/download-artifact@v3 with: name: lockfile path: tools/lockfile diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 31723902..9e1fc15c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,10 +42,14 @@ jobs: terraform_version: ${{ env.TERRAFORM_VERSION }} terraform_wrapper: false - - shell: bash + - name: Build lockfile and fetch providers + shell: bash run: | + mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} + echo 'plugin_cache_dir = "${{ env.TF_PLUGIN_CACHE_DIR }}"' | tee -a /home/runner/.terraformrc + echo 'disable_checkpoint = true' | tee -a /home/runner/.terraformrc cp default-versions.tf tools/lockfile - sed -i 's/>=\(.*# tftest\)/=\1/g' tools/lockfile/default-versions.tf; + sed -i 's/>=\(.*# tftest\)/=\1/g' tools/lockfile/default-versions.tf cd tools/lockfile terraform init @@ -55,21 +59,13 @@ jobs: path: ${{ env.TF_PLUGIN_CACHE_DIR }} key: ${{ runner.os }}-terraform-${{ hashFiles('tools/lockfile/.terraform.lock.hcl') }} - - shell: bash - run: | - mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} - echo 'plugin_cache_dir = "/home/runner/.terraform.d/plugin-cache"' | tee -a /home/runner/.terraformrc - echo 'disable_checkpoint = true' | tee -a /home/runner/.terraformrc - cd tools/lockfile - rm -rf .terraform* - terraform init - - name: tf provider cache content shell: bash run: | ls -Ra /home/runner/.terraform.d/plugin-cache - - uses: actions/upload-artifact@v3 + - name: Upload lockfile + uses: actions/upload-artifact@v3 with: name: lockfile path: tools/lockfile/.terraform.lock.hcl