-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,432 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: Validate and Test Terraform manifests | ||
|
||
on: | ||
pull_request: | ||
|
||
env: | ||
TERRAFORM_VERSION: ~1.9 | ||
|
||
jobs: | ||
terraform: | ||
name: terraform | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: ${{ env.TERRAFORM_VERSION }} | ||
|
||
- name: Ensure Terraform code is formated | ||
run: terraform fmt -check | ||
|
||
- name: Terraform Init | ||
run: terraform init | ||
|
||
- name: Validate Terraform code | ||
run: terraform validate -no-color | ||
|
||
trivy: | ||
name: trivy | ||
runs-on: ubuntu-latest | ||
needs: terraform | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: ${{ env.TERRAFORM_VERSION }} | ||
|
||
- name: Terraform Init | ||
run: terraform init | ||
|
||
- name: Run trivy with reviewdog output on the PR | ||
uses: reviewdog/action-trivy@v1 | ||
with: | ||
trivy_command: config | ||
trivy_target: . | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-review | ||
filter_mode: diff_context | ||
fail_on_error: "true" | ||
|
||
tflint: | ||
name: tflint | ||
runs-on: ubuntu-latest | ||
needs: terraform | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: ${{ env.TERRAFORM_VERSION }} | ||
|
||
- name: Terraform Init | ||
run: terraform init | ||
|
||
- name: Check with tflint | ||
uses: reviewdog/action-tflint@v1 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-review | ||
fail_on_error: "true" | ||
filter_mode: diff_context | ||
flags: "--module" | ||
|
||
terratest: | ||
name: terratest | ||
runs-on: ubuntu-latest | ||
needs: | ||
- terraform | ||
- trivy | ||
- tflint | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: ${{ env.TERRAFORM_VERSION }} | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: tests/go.mod | ||
cache-dependency-path: | | ||
tests/go.sum | ||
- name: Run terratest | ||
run: make terratest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,17 +11,8 @@ jobs: | |
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: Render terraform docs inside the examples/basic/README.md | ||
- name: Render terraform docs | ||
uses: terraform-docs/[email protected] | ||
with: | ||
working-dir: ./examples/basic/ | ||
git-push: "false" | ||
output-file: README.md | ||
config-file: ./examples/basic/.terraform-docs.yml | ||
|
||
- name: Render terraform docs inside the README.md | ||
uses: terraform-docs/[email protected] | ||
with: | ||
working-dir: . | ||
working-dir: .,./examples/basic | ||
git-push: "true" | ||
output-file: README.md |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ on: | |
jobs: | ||
lint-pr: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Lint PR | ||
uses: amannn/action-semantic-pull-request@v5 | ||
|
@@ -50,3 +49,10 @@ jobs: | |
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) | ||
* **test**: Adding missing tests or correcting existing tests | ||
* **chore**: No production code change | ||
- name: Add label to PR | ||
if: github.actor != 'dependabot[bot]' | ||
uses: fuxingloh/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
config-path: .github/labeler.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
terratest: | ||
cd tests; go mod tidy; go test -v -count=1 ./...; cd - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.