Skip to content

Commit

Permalink
ci: test setup action using OpenTofu (#2133)
Browse files Browse the repository at this point in the history
* ci: test setup action using OpenTofu

* ci: fix duplicated id

* chore: update .terraform.lock.hcl

---------

Co-authored-by: suzuki-shunsuke-app[bot] <91834585+suzuki-shunsuke-app[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 5cff56e commit c454711
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/wc-create-pr-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,18 @@ jobs:
TFACTION_WORKING_DIR: setup/test/foo
TFACTION_JOB_TYPE: terraform

- name: Test OpenTofu (setup)
uses: ./setup
with:
github_token: ${{steps.token.outputs.token}}
if: |
! github.event.pull_request.head.repo.fork
env:
TFACTION_CONFIG: setup/test/opentofu/tfaction-root.yaml
TFACTION_TARGET: setup/test/opentofu/foo
TFACTION_WORKING_DIR: setup/test/opentofu/foo
TFACTION_JOB_TYPE: terraform

- name: Test test
uses: ./test
with:
Expand Down
29 changes: 27 additions & 2 deletions aqua-checksums.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,31 @@
"checksum": "6E4C6ACD38DE7B4B1BA8F8082B9E688DF8C9B861D3F8B2E7BB1B7270201A3587",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/opentofu/opentofu/v1.8.7/tofu_1.8.7_darwin_amd64.zip",
"checksum": "7FF1307EC5DD14B2660EC91B39354CEC24AA492A03338D8A37FB542FB0B031F7",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/opentofu/opentofu/v1.8.7/tofu_1.8.7_darwin_arm64.zip",
"checksum": "FEC8D934B9F69E033154265B60677604777505D3634945B3043C46E0030B5E5D",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/opentofu/opentofu/v1.8.7/tofu_1.8.7_linux_amd64.zip",
"checksum": "6935F082EF120FDB05F608DDE61ACE6B82D134496634586F42C8E38856B3E411",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/opentofu/opentofu/v1.8.7/tofu_1.8.7_linux_arm64.zip",
"checksum": "5CE3686C20C9D639E99A064AF5CF0D781361B0874426B2343A9AB4E33D25DB4F",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/opentofu/opentofu/v1.8.7/tofu_1.8.7_windows_amd64.zip",
"checksum": "C63B55B322CA292491D8151CF24F43BA64F3522F896F13B16A49477A362580DF",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/reviewdog/reviewdog/v0.20.3/reviewdog_0.20.3_Darwin_arm64.tar.gz",
"checksum": "A7FBF41913CE5B6F1872D10C136139B7A849190F4F1F0DC1ED4BF74C636F22A2",
Expand Down Expand Up @@ -291,8 +316,8 @@
"algorithm": "sha256"
},
{
"id": "registries/github_content/github.com/aquaproj/aqua-registry/v4.280.0/registry.yaml",
"checksum": "6B5BB3DBC8AE412B5EF31232D06FBD81215E6431270FA7BAD4AAF0BC167C0A82",
"id": "registries/github_content/github.com/aquaproj/aqua-registry/v4.282.0/registry.yaml",
"checksum": "58657FD69E9B7557F828DC0DF30134AE2D8E2111D3FA9347A376E14B9A7DE463",
"algorithm": "sha256"
}
]
Expand Down
2 changes: 2 additions & 0 deletions aqua/opentofu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- name: opentofu/[email protected]
22 changes: 22 additions & 0 deletions setup/test/opentofu/foo/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions setup/test/opentofu/foo/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resource "null_resource" "foo" {}
1 change: 1 addition & 0 deletions setup/test/opentofu/foo/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
provider "null" {}
9 changes: 9 additions & 0 deletions setup/test/opentofu/foo/terraform.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.0"
required_providers {
null = {
source = "hashicorp/null"
version = "3.2.3"
}
}
}
1 change: 1 addition & 0 deletions setup/test/opentofu/foo/tfaction.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
61 changes: 61 additions & 0 deletions setup/test/opentofu/tfaction-root.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
plan_workflow_name: test

label_prefixes:
tfmigrate: "migrate:"
skip_terraform_by_renovate: true
renovate_terraform_labels:
- terraform
providers_lock_opts: -platform=linux_amd64 -platform=darwin_arm64
tfcmt_plan_patch: true
# conftest_policy_directory: conftest-policy

# skip_create_pr: true

terraform_command: tofu

conftest:
policies:
- policy: js/test/conftest/policy
tf: true

update_local_path_module_caller:
enabled: true

trivy:
enabled: true
tfsec:
enabled: false
tflint:
enabled: true
fix: true

scaffold_working_directory:
skip_adding_aqua_packages: true

# aqua:
# update_checksum:
# # Update aqua-checksums.json in `setup` action
# enabled: true # default is false
# skip_push: false # default is false
# prune: true # default is false

update_related_pull_requests:
enabled: true

drift_detection:
enabled: false
issue_repo_owner: suzuki-shunsuke
issue_repo_name: tfaction
minimum_detection_interval: 1
num_of_issues: 1

replace:
patterns:
- regexp: /services/
replace: /

target_groups:
- working_directory: setup/test/
target: setup/test/
template_dir: js/test/templates/aws

0 comments on commit c454711

Please sign in to comment.