generated from SweetOps/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 5
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
25 changed files
with
1,768 additions
and
169 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
labels: | ||
- ci | ||
commit-message: | ||
prefix: "[skip-release] ci:" | ||
- package-ecosystem: "terraform" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
labels: | ||
- build | ||
commit-message: | ||
prefix: "build:" | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
labels: | ||
- build | ||
commit-message: | ||
prefix: "[skip-release] build:" |
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 |
---|---|---|
|
@@ -6,30 +6,13 @@ jobs: | |
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: Render terraform docs inside the examples/basic/README.md | ||
uses: terraform-docs/gh-actions@v1.0.0 | ||
- name: Render terraform docs | ||
uses: terraform-docs/gh-actions@v1.2.0 | ||
with: | ||
working-dir: ./examples/basic/ | ||
git-push: "false" | ||
output-file: README.md | ||
config-file: ".terraform-docs.yml" | ||
|
||
- name: Render terraform docs inside the examples/basic/README.md | ||
uses: terraform-docs/[email protected] | ||
with: | ||
working-dir: ./examples/replicated/ | ||
git-push: "false" | ||
output-file: README.md | ||
config-file: ".terraform-docs.yml" | ||
|
||
- name: Render terraform docs inside the README.md | ||
uses: terraform-docs/[email protected] | ||
with: | ||
working-dir: . | ||
working-dir: .,./examples/basic,./examples/replicated | ||
git-push: "true" | ||
output-file: README.md | ||
config-file: ".terraform-docs.yml" |
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 |
---|---|---|
@@ -1,21 +1,25 @@ | ||
--- | ||
name: Sync labels | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
paths: | ||
- ".github/labels.yml" | ||
- ".github/workflows/labels.yml" | ||
|
||
jobs: | ||
sync-labels: | ||
name: Sync labels in the declarative way | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: micnncim/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_REPOSITORY: ${{ github.repository }} | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Sync labels | ||
uses: crazy-max/ghaction-github-labeler@v5 | ||
with: | ||
manifest: .github/labels.yml | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
yaml-file: .github/labels.yml | ||
dry-run: ${{ github.event_name == 'pull_request' }} |
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 |
---|---|---|
|
@@ -4,25 +4,34 @@ on: | |
pull_request_target: | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
lint-pr: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Lint PR | ||
uses: aslafy-z/[email protected] | ||
uses: amannn/action-semantic-pull-request@v5 | ||
with: | ||
preset: conventional-changelog-angular@^5.0.6 | ||
types: | | ||
build | ||
ci | ||
docs | ||
feat | ||
fix | ||
perf | ||
refactor | ||
style | ||
test | ||
chore | ||
requireScope: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Comment for PR title conformance | ||
if: failure() | ||
uses: peter-evans/create-or-update-comment@v3 | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
issue-number: ${{tojson(github.event.number)}} | ||
body: | | ||
|
@@ -40,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.
Oops, something went wrong.