Skip to content

Commit

Permalink
Prepare fo new Ci pipeline (#22)
Browse files Browse the repository at this point in the history
* prepare for ci
  • Loading branch information
lonegunmanb committed May 22, 2023
1 parent 9e5038e commit 8ed5d83
Show file tree
Hide file tree
Showing 36 changed files with 876 additions and 498 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"
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Describe your changes

## Issue number

#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!

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

permissions:
contents: write
pull-requests: read

jobs:
acc-tests:
runs-on: [self-hosted, 1ES.Pool=terraform-azurerm-database]
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: upload test version snapshots
uses: actions/upload-artifact@v3
with:
name: TestRecord-${{ github.event.number }}
retention-days: 60
path: |
examples/**/TestRecord.md.tmp
- name: version-upgrade test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sh scripts/ci-version-upgrade.sh
15 changes: 15 additions & 0 deletions .github/workflows/breaking-change-detect.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Comment on PR'

permissions:
contents: read
pull-requests: read

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/post-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Post Push
on:
push:
branches:
- main
- master
tags:
- '*'

permissions: write-all

jobs:
post-push:
if: github.actor != 'github-actions[bot]'
uses: Azure/tfmod-scaffold/.github/workflows/post-push.yaml@main
19 changes: 19 additions & 0 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Pre Pull Request Check
on:
pull_request:
types: ['opened', 'synchronize']
paths:
- '.github/**'
- '**.go'
- '**.tf'
- '.github/workflows/**'
- '**.md'
- '**/go.mod'

permissions:
contents: read
pull-requests: read

jobs:
prepr-check:
uses: Azure/tfmod-scaffold/.github/workflows/pr-check.yaml@main
33 changes: 33 additions & 0 deletions .github/workflows/weekly-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Weekly E2E Test Check
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'

permissions:
contents: write

jobs:
full-e2e-check:
runs-on: [self-hosted, 1ES.Pool=terraform-azurerm-database]
environment:
name: crontests
steps:
- name: checkout
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
continue-on-error: true
run: |
sh scripts/ci-e2e.sh
- name: Update
run: |
sh scripts/ci-update-test-record.sh
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'Update TestVersionSnapshot'
branch: ${{ github.event.repository.default_branch }}
Loading

0 comments on commit 8ed5d83

Please sign in to comment.