From 744863b9a34dea7d42d24c7fa9d3cbb3ec1f6d86 Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Thu, 9 Mar 2023 15:52:01 +0100 Subject: [PATCH] Simplify testing workflow --- .github/actions/fabric-tests/action.yml | 6 ++++- .github/workflows/tests.yml | 29 +++++-------------------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/.github/actions/fabric-tests/action.yml b/.github/actions/fabric-tests/action.yml index df5b1bd0..aae958fc 100644 --- a/.github/actions/fabric-tests/action.yml +++ b/.github/actions/fabric-tests/action.yml @@ -45,7 +45,7 @@ runs: | tee -a /home/runner/.terraformrc echo 'disable_checkpoint = true' \ | tee -a /home/runner/.terraformrc - mkdir -p /home/runner/.terraform.d/plugin-cache + mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} # avoid conflicts with user-installed providers on local machines - name: Pin provider versions shell: bash @@ -53,3 +53,7 @@ runs: for f in $(find . -name versions.tf); do sed -i 's/>=\(.*# tftest\)/=\1/g' $f; done + - name: Install Python Dependencies + shell: bash + run: | + pip install -r tests/requirements.txt diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5614b048..aed551af 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,10 +43,7 @@ jobs: TERRAFORM_VERSION: ${{ env.TERRAFORM_VERSION }} - name: Run tests on documentation examples - id: pytest - run: | - pip install -r tests/requirements.txt - pytest -vv -k blueprints/ tests/examples + run: pytest -vv -k blueprints/ tests/examples examples-modules: runs-on: ubuntu-latest @@ -60,11 +57,7 @@ jobs: TERRAFORM_VERSION: ${{ env.TERRAFORM_VERSION }} - name: Run tests on documentation examples - id: pytest - run: | - mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} - pip install -r tests/requirements.txt - pytest -vv -k modules/ tests/examples + run: pytest -vv -k modules/ tests/examples blueprints: runs-on: ubuntu-latest @@ -78,11 +71,7 @@ jobs: TERRAFORM_VERSION: ${{ env.TERRAFORM_VERSION }} - name: Run tests environments - id: pytest - run: | - mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} - pip install -r tests/requirements.txt - pytest -vv tests/blueprints + run: pytest -vv tests/blueprints modules: runs-on: ubuntu-latest @@ -96,11 +85,7 @@ jobs: TERRAFORM_VERSION: ${{ env.TERRAFORM_VERSION }} - name: Run tests modules - id: pytest - run: | - mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} - pip install -r tests/requirements.txt - pytest -vv tests/modules + run: pytest -vv tests/modules fast: runs-on: ubuntu-latest @@ -114,8 +99,4 @@ jobs: TERRAFORM_VERSION: ${{ env.TERRAFORM_VERSION }} - name: Run tests on FAST stages - id: pytest - run: | - mkdir -p ${{ env.TF_PLUGIN_CACHE_DIR }} - pip install -r tests/requirements.txt - pytest -vv tests/fast + run: pytest -vv tests/fast