Skip to content

ci: re-enabled tests #241

ci: re-enabled tests

ci: re-enabled tests #241

Workflow file for this run

---
name: TF Tests
on:
pull_request:
paths: [.github/workflows/tf_tests.yaml, tests/**]
types: [opened, reopened, synchronize, closed]
jobs:
tests:
runs-on: ubuntu-24.04
permissions:
actions: read # Required to download repository artifact.
checks: write # Required to add status summary.
contents: read # Required to checkout repository.
pull-requests: write # Required to add PR comment and label.
strategy:
fail-fast: false
matrix:
tool: [tofu, terraform]
test:
- pass_one
- pass_character_limit
- pass_format_diff
# - fail_invalid_resource_type
# - fail_data_source_error
steps:
- name: Echo github
env:
GH_JSON: ${{ toJson(github) }}
run: echo "$GH_JSON"
- name: Echo context
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: console.log(JSON.stringify(context, null, 2))
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Setup Terraform
if: matrix.tool == 'terraform'
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
- name: Setup OpenTofu
if: matrix.tool == 'tofu'
uses: opentofu/setup-opentofu@12f4debbf681675350b6cd1f0ff8ecfbda62027b # v1.0.4
- name: Provision TF
id: tf
continue-on-error: true
uses: ./
with:
command: ${{ github.event.pull_request.merged && 'apply' || 'plan' }}
arg-lock: ${{ github.event.pull_request.merged }}
working-directory: tests/${{ matrix.test }}
tool: ${{ matrix.tool }}
format: true
- name: Echo TF
run: |
echo "check-id: ${{ steps.tf.outputs.check-id }}"
echo "command: ${{ steps.tf.outputs.command }}"
echo "comment-id: ${{ steps.tf.outputs.comment-id }}"
echo "diff: ${{ steps.tf.outputs.diff }}"
echo "exitcode: ${{ steps.tf.outputs.exitcode }}"
echo "identifier: ${{ steps.tf.outputs.identifier }}"
echo "job-id: ${{ steps.tf.outputs.job-id }}"
echo "plan-id: ${{ steps.tf.outputs.plan-id }}"
echo "plan-url: ${{ steps.tf.outputs.plan-url }}"
echo "result: ${{ steps.tf.outputs.result }}"
echo "run-url: ${{ steps.tf.outputs.run-url }}"
echo "summary: ${{ steps.tf.outputs.summary }}"