Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ on:
# every commit pushed to main can complete its validation.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
# Only cancel superseded pull request runs.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

# CI only needs to read repository contents.
Expand Down Expand Up @@ -67,4 +66,33 @@ jobs:
working-directory: environments/test/frontend
run: |
tofu init -backend=false -input=false -lockfile=readonly
tofu validate -no-color
tofu validate -no-color
# Install a pinned TFLint version for static code analysis.
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v6
with:
tflint_version: v0.64.0

# Inspect all OpenTofu root modules and reusable modules.
# Use the shared configuration from the repository root.
- name: Run TFLint
run: |
tflint --init --config="$GITHUB_WORKSPACE/.tflint.hcl"
tflint --recursive --config="$GITHUB_WORKSPACE/.tflint.hcl" --format=compact
# Install Checkov in an isolated Python environment.
- name: Install Checkov
run: |
python3 -m venv "$RUNNER_TEMP/checkov-venv"
"$RUNNER_TEMP/checkov-venv/bin/python" -m pip install "checkov==3.4.0"
# Scan OpenTofu configurations and GitHub Actions workflows.
- name: Run Checkov
run: |
"$RUNNER_TEMP/checkov-venv/bin/checkov" \
--directory . \
--framework terraform,github_actions \
--skip-path '\.terraform/' \
--quiet
4 changes: 4 additions & 0 deletions .tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugin "terraform" {
enabled = true
preset = "recommended"
}
2 changes: 2 additions & 0 deletions modules/network/providers.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
terraform {
required_version = ">= 1.12.0"

required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
Expand Down
2 changes: 2 additions & 0 deletions modules/vm/providers.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
terraform {
required_version = ">= 1.12.0"

required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
Expand Down