Simplify testing workflow

This commit is contained in:
Julio Castillo 2023-03-09 15:52:01 +01:00
parent 1ff3bf9327
commit 744863b9a3
2 changed files with 10 additions and 25 deletions

View File

@ -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

View File

@ -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