Skip to content

Add terraform-test action #2

Add terraform-test action

Add terraform-test action #2

Workflow file for this run

name: Test terraform-test
on:
- push
jobs:
default:
runs-on: ubuntu-latest
name: Default inputs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check
uses: ./terraform-test
with:
path: tests/workflows/test-test/local
filter:
runs-on: ubuntu-latest
name: Default path with a filter
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check
uses: ./terraform-test
with:
path: tests/workflows/test-test/local
filter: main.tftest.hcl
test_dir:
runs-on: ubuntu-latest
name: Custom test directory
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check
uses: ./terraform-test
with:
path: tests/workflows/test-test/local
test_path: custom-test-dir
filter: |
another.tftest.hcl
a-third.tftest.hcl
failing:
runs-on: ubuntu-latest
name: A failing test using variables
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check
uses: ./terraform-test
id: failing
continue-on-error: true
with:
path: tests/workflows/test-test/local
filter: main.tftest.hcl
variables: |
length = 1
- name: Check failure-reason
run: |
if [[ "${{ steps.failing.outcome }}" != "failure" ]]; then
echo "Test did not fail correctly"
exit 1
fi