Skip to content

Commit

Permalink
Prepare for CI (#49)
Browse files Browse the repository at this point in the history
* Prepare for CI

Co-authored-by: zjhe <hezijie@microsoft.com>
  • Loading branch information
lonegunmanb and lonegunmanb committed Jan 9, 2023
1 parent 71e0137 commit b8f7133
Show file tree
Hide file tree
Showing 33 changed files with 1,618 additions and 471 deletions.
26 changes: 26 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"image": "mcr.microsoft.com/azterraform:latest",

"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined",
"--init",
"--network=host"
],

"mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
"customizations": {
"vscode": {
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.goroot": "/usr/local/go"
},
"extensions": [
"hashicorp.terraform",
"golang.Go"
]
}
}
}
120 changes: 120 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_Report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Bug Report
description: If something isn't working as expected.
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to fill out a bug report.
If you are not running the latest version of this module, please try to reproduce your bug with the latest version before opening an issue.
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: dropdown
attributes:
label: Greenfield/Brownfield provisioning
description: Do you reproduce the bug with a new infrastructure provisioning (greenfield) or you need an existing infrastructure with an existing terraform state (brownfield) to reproduce the bug ?
multiple: false
options:
- greenfield
- brownfield
validations:
required: true
- type: input
id: terraform
attributes:
label: Terraform Version
description: Which Terraform version are you using?
placeholder: Example value, 1.2.8
validations:
required: true
- type: input
id: module
attributes:
label: Module Version
description: Which module version are you using?
placeholder: Example value, 6.0.0
validations:
required: true
- type: input
id: azurerm
attributes:
label: AzureRM Provider Version
description: Which AzureRM Provider version are you using?
placeholder: Example value, 3.21.1
validations:
required: true
- type: input
id: resource
attributes:
label: Affected Resource(s)/Data Source(s)
description: Please list the affected resources and/or data sources.
placeholder: azurerm_XXXXX
validations:
required: true
- type: textarea
id: config
attributes:
label: Terraform Configuration Files
description: |
Please provide a minimal Terraform configuration that can reproduce the issue.
render: hcl
validations:
required: true
- type: textarea
id: tfvars
attributes:
label: tfvars variables values
description: |
Please provide the necessary tfvars variables values to reproduce the issue. Do not share secrets or sensitive information.
render: hcl
validations:
required: true
- type: textarea
id: debug
attributes:
label: Debug Output/Panic Output
description: |
For long debug logs please provide a link to a GitHub Gist containing the complete debug output. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
To obtain the debug output, see the [Terraform documentation on debugging](https://www.terraform.io/docs/internals/debugging.html).
render: shell
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected Behaviour
description: What should have happened?
- type: textarea
id: actual
attributes:
label: Actual Behaviour
description: What actually happened?
- type: textarea
id: reproduce
attributes:
label: Steps to Reproduce
description: |
Please list the steps required to reproduce the issue, e.g.
1. `terraform apply`
- type: input
id: facts
attributes:
label: Important Factoids
description: |
Are there anything atypical about your accounts that we should know? For example: Running in a Azure China/Germany/Government?
- type: textarea
id: references
attributes:
label: References
description: |
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Such as vendor documentation?
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_Request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Feature Request
description: I have a suggestion (and might want to implement myself)!
title: "Support for [thing]"
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the feature you are requesting.
options:
- label: I have searched the existing issues
required: true
- type: textarea
id: description
attributes:
label: Description
description: Please leave a helpful description of the feature request here.
validations:
required: true
- type: input
id: resource
attributes:
label: New or Affected Resource(s)/Data Source(s)
description: Please list the new or affected resources and/or data sources.
placeholder: azurerm_XXXXX
validations:
required: true
- type: textarea
id: config
attributes:
label: Potential Terraform Configuration
description: Please provide an example of what the enhancement could look like on this Terraform module.
render: hcl
- type: textarea
id: references
attributes:
label: References
description: |
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor blog posts or documentation? For example:
* https://azure.microsoft.com/en-us/roadmap/virtual-network-service-endpoint-for-azure-cosmos-db/
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/test"
schedule:
interval: "weekly"
19 changes: 9 additions & 10 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<!---
Please add this into the test of test/fixture, format the changes by "terraform fmt", and test it by run the following:
```sh
$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-loadbalancer .
$ docker run --rm azure-loadbalancer /bin/bash -c "bundle install && rake full"
```
Please add this into the example usage of README.md and format the changes by "terrafmt fmt README.md". Please intall "terrafmt" by [install terrafmt](https://github.com/katbyte/terrafmt#install).
--->
## Describe your changes

Fixes #000
## Issue number

Changes proposed in the pull request:
#000

## Checklist before requesting a review
- [ ] The pr title can be used to describe what this pr did in `CHANGELOG.md` file
- [ ] I have executed pre-commit on my machine
- [ ] I have passed pr-check on my machine

Thanks for your cooperation!

28 changes: 28 additions & 0 deletions .github/workflows/acc-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: E2E Test
on:
pull_request:
types: [ 'opened', 'synchronize' ]
paths:
- '.github/**'
- '**.go'
- '**.tf'
- '.github/workflows/**'
- '**.md'
- '**/go.mod'

jobs:
acc-tests:
runs-on: [self-hosted, 1ES.Pool=terraform-azurerm-loadbalancer]
environment:
name: acctests
steps:
- uses: actions/checkout@v3
- name: init
run: |
docker run --rm -v $(pwd):/src -w /src mcr.microsoft.com/azterraform:latest make generate
- name: e2e test
run: |
sh scripts/ci-e2e.sh
- name: version-upgrade test
run: |
sh scripts/ci-version-upgrade.sh
11 changes: 11 additions & 0 deletions .github/workflows/breaking-change-detect.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'Comment on PR'

on:
workflow_run:
workflows: ["Pre Pull Request Check"]
types:
- completed

jobs:
comment:
uses: Azure/tfmod-scaffold/.github/workflows/breaking-change-detect.yaml@main
15 changes: 15 additions & 0 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Pre Pull Request Check
on:
pull_request:
types: ['opened', 'synchronize']
paths:
- '.github/**'
- '**.go'
- '**.tf'
- '.github/workflows/**'
- '**.md'
- '**/go.mod'

jobs:
prepr-check:
uses: Azure/tfmod-scaffold/.github/workflows/pr-check.yaml@main
12 changes: 12 additions & 0 deletions .github/workflows/update-changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Update Changelog
on:
push:
branches:
- main
- master
tags:
- '*'

jobs:
update-changelog:
uses: Azure/tfmod-scaffold/.github/workflows/update-changelog.yaml@main
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Variable files
terraform.tfvars
**/.terraform
**/.terraform.lock.hcl

### https://raw.github.com/github/gitignore/abad92dac5a4306f72242dae3bca6e277bce3615/Terraform.gitignore

Expand Down Expand Up @@ -42,3 +44,9 @@ Gemfile.lock

# Mac folder attribute file
.DS_Store

.tflint.hcl
.tflint_example.hcl
tfmod-scaffold
README-generated.md
scripts
Loading

0 comments on commit b8f7133

Please sign in to comment.