Skip to content

Fix/yaml spec

Fix/yaml spec #15

Workflow file for this run

name: CI
on:
pull_request:
paths:
- "**.tf"
- "tests/**"
- "schemas/**"
- "docs/reference/**"
- ".terraform-docs.yml"
- ".github/workflows/ci.yml"
- "!topologies/**"
push:
branches: [main]
paths:
- "**.tf"
- "tests/**"
- "schemas/**"
- "docs/reference/**"
- ".terraform-docs.yml"
- "!topologies/**"
permissions:
contents: read
jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3
with:
terraform_version_file: .terraform-version
- name: Cache Terraform providers
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: .terraform
key: terraform-${{ hashFiles('.terraform.lock.hcl') }}
restore-keys: terraform-
- name: Format check
run: terraform fmt -check -recursive
- name: Init
run: terraform init -backend=false
- name: Set up tflint
uses: terraform-linters/setup-tflint@90f302c255ef959cbfb4bd10581afecdb7ece3e6 # v4
with:
tflint_version: latest
- name: Lint
run: |
tflint --init
tflint --recursive
- name: Test (mock providers)
run: terraform test
docs:
name: Docs up to date
runs-on: ubuntu-latest
env:
TERRAFORM_DOCS_VERSION: v0.20.0
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install terraform-docs
run: |
wget -q -O /tmp/terraform-docs.tar.gz \
https://github.com/terraform-docs/terraform-docs/releases/download/${TERRAFORM_DOCS_VERSION}/terraform-docs-${TERRAFORM_DOCS_VERSION}-linux-amd64.tar.gz
tar -xzf /tmp/terraform-docs.tar.gz -C /tmp
sudo mv /tmp/terraform-docs /usr/local/bin/
chmod +x /usr/local/bin/terraform-docs
- name: Regenerate docs
run: make docs
- name: Check for drift
run: |
if ! git diff --exit-code docs/reference/; then
echo ""
echo "Docs are out of date. Run 'make docs' locally and commit the result."
exit 1
fi