This repository has been archived by the owner on Nov 23, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update CI/CD process to enable auto-release workflow (#12)
- Loading branch information
1 parent
1849697
commit 1ede969
Showing
33 changed files
with
900 additions
and
740 deletions.
There are no files selected for viewing
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 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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Pre-Commit | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
|
||
env: | ||
TERRAFORM_DOCS_VERSION: v0.16.0 | ||
|
||
jobs: | ||
collectInputs: | ||
name: Collect workflow inputs | ||
runs-on: ubuntu-latest | ||
outputs: | ||
directories: ${{ steps.dirs.outputs.directories }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get root directories | ||
id: dirs | ||
uses: clowdhaus/terraform-composite-actions/directories@v1.3.0 | ||
|
||
preCommitMinVersions: | ||
name: Min TF pre-commit | ||
needs: collectInputs | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
directory: ${{ fromJson(needs.collectInputs.outputs.directories) }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Terraform min/max versions | ||
id: minMax | ||
uses: clowdhaus/terraform-min-max@v1.0.3 | ||
with: | ||
directory: ${{ matrix.directory }} | ||
|
||
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} | ||
# Run only validate pre-commit check on min version supported | ||
if: ${{ matrix.directory != '.' }} | ||
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0 | ||
with: | ||
terraform-version: ${{ steps.minMax.outputs.minVersion }} | ||
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*' | ||
|
||
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} | ||
# Run only validate pre-commit check on min version supported | ||
if: ${{ matrix.directory == '.' }} | ||
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0 | ||
with: | ||
terraform-version: ${{ steps.minMax.outputs.minVersion }} | ||
args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)' | ||
|
||
preCommitMaxVersion: | ||
name: Max TF pre-commit | ||
runs-on: ubuntu-latest | ||
needs: collectInputs | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
repository: ${{github.event.pull_request.head.repo.full_name}} | ||
|
||
- name: Terraform min/max versions | ||
id: minMax | ||
uses: clowdhaus/terraform-min-max@v1.0.3 | ||
|
||
- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }} | ||
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0 | ||
with: | ||
terraform-version: ${{ steps.minMax.outputs.maxVersion }} | ||
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }} |
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,32 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
paths: | ||
- '**/*.py' | ||
- '**/*.tf' | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
|
||
- name: Release | ||
uses: cycjimmy/semantic-release-action@v2 | ||
with: | ||
semantic_version: 18.0.0 | ||
extra_plugins: | | ||
@semantic-release/changelog@6.0.0 | ||
@semantic-release/git@10.0.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }} |
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,4 +1,29 @@ | ||
.terraform | ||
terraform.tfstate | ||
*.tfstate* | ||
terraform.tfvars | ||
# Local .terraform directories | ||
**/.terraform/* | ||
|
||
# Terraform lockfile | ||
.terraform.lock.hcl | ||
|
||
# .tfstate files | ||
*.tfstate | ||
*.tfstate.* | ||
|
||
# Crash log files | ||
crash.log | ||
|
||
# Exclude all .tfvars files, which are likely to contain sentitive data, such as | ||
# password, private keys, and other secrets. These should not be part of version | ||
# control as they are data points which are potentially sensitive and subject | ||
# to change depending on the environment. | ||
*.tfvars | ||
|
||
# Ignore override files as they are usually used to override resources locally and so | ||
# are not checked in | ||
override.tf | ||
override.tf.json | ||
*_override.tf | ||
*_override.tf.json | ||
|
||
# Ignore CLI configuration files | ||
.terraformrc | ||
terraform.rc |
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,10 +1,28 @@ | ||
repos: | ||
- repo: git://github.com/antonbabenko/pre-commit-terraform | ||
rev: v1.27.0 | ||
- repo: https://github.com/antonbabenko/pre-commit-terraform | ||
rev: v1.58.0 | ||
hooks: | ||
- id: terraform_fmt | ||
- id: terraform_validate | ||
- id: terraform_docs | ||
- repo: git://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.5.0 | ||
args: | ||
- '--args=--lockfile=false' | ||
- id: terraform_tflint | ||
args: | ||
- '--args=--only=terraform_deprecated_interpolation' | ||
- '--args=--only=terraform_deprecated_index' | ||
- '--args=--only=terraform_unused_declarations' | ||
- '--args=--only=terraform_comment_syntax' | ||
- '--args=--only=terraform_documented_outputs' | ||
- '--args=--only=terraform_documented_variables' | ||
- '--args=--only=terraform_typed_variables' | ||
- '--args=--only=terraform_module_pinned_source' | ||
- '--args=--only=terraform_naming_convention' | ||
- '--args=--only=terraform_required_version' | ||
- '--args=--only=terraform_required_providers' | ||
- '--args=--only=terraform_standard_module_structure' | ||
- '--args=--only=terraform_workspace_remote' | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: check-merge-conflict |
Oops, something went wrong.