-
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
1 parent
1b6936f
commit bd8f0dd
Showing
6 changed files
with
179 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Codecov | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
codecov: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
TF_ACC: "1" | ||
NSXT_MANAGER_HOST: "10.92.116.5" | ||
NSXT_USERNAME: "admin" | ||
NSXT_PASSWORD: "V6*IiT5VmM*+" | ||
NSXT_ORG: "default" | ||
NSXT_PROJECT: "Dev_project" | ||
NSXT_VPC: "dev_vpc" | ||
NSXT_PROJECT_INFRA_TEST_GROUP_NAME: "ORG-default-PROJECT-Dev_project-VPC-dev_vpc-default" | ||
NSXT_PROJECT_INFRA_TEST_IP_ADDRESS_BLOCK_NAME: "ip_block_dev" | ||
NSXT_PROJECT_INFRA_TEST_IP_ADDRESS_POOL_NAME: "_VPC_IP_ADDRESS_POOL--dev_vpc" | ||
NSXT_PROJECT_INFRA_TEST_CONTEXT_PROFILE_NAME: "360ANTIV" | ||
NSXT_PROJECT_INFRA_TEST_SERVICE_ID: "Active_Directory_Server" | ||
NSXT_INFRA_TEST_GROUP_NAME: "ServiceInsertion_NSGroup" | ||
NSXT_INFRA_TEST_IP_ADDRESS_BLOCK_NAME: "ip_block_test" | ||
NSXT_INFRA_TEST_IP_ADDRESS_POOL_NAME: "test-ip-pool" | ||
NSXT_INFRA_TEST_CONTEXT_PROFILE_ID: "360ANTIV" | ||
NSXT_INFRA_TEST_SERVICE_ID: "Active_Directory_Server" | ||
NSXT_TEST_VM_ID: "86f07fcf-46b5-40e9-8544-1a469d9c6a65" | ||
NSXT_TEST_VM_EXTERNAL_ID: "86f07fcf-46b5-40e9-8544-1a469d9c6a65" | ||
NSXT_TEST_VM_POWER_STATE: "VM_RUNNING" | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Terraform | ||
uses: hashicorp/setup-terraform@v1 | ||
with: | ||
terraform_version: 1.4.2 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Install dependencies | ||
run: | | ||
go get -v ./... | ||
- name: Run tests and generate coverage report | ||
run: | | ||
TF_ACC=1 go test -v -coverprofile=coverage_report.json ./nsxt/ | ||
go tool cover -html=coverage_report.json -o coverage_report.html | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: golangci-lint | ||
on: | ||
pull_request: | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.45 | ||
args: --issues-exit-code=1 | ||
only-new-issues: true | ||
skip-pkg-cache: true | ||
skip-build-cache: true |
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,27 @@ | ||
name: "Stale issues and pull requests" | ||
on: | ||
schedule: | ||
- cron: "40 17 * * *" | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v3 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
days-before-stale: 360 | ||
days-before-close: 30 | ||
exempt-issue-labels: 'needs-triage' | ||
exempt-pr-labels: 'needs-triage' | ||
operations-per-run: 100 | ||
stale-issue-label: 'stale' | ||
stale-issue-message: | | ||
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. | ||
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! | ||
stale-pr-label: 'stale' | ||
stale-pr-message: | | ||
Marking this pull request as stale due to inactivity. This helps our maintainers find and focus on the active pull requests. If this pull request receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. | ||
If this pull request was automatically closed and you feel this pull request should be reopened, we encourage creating a new pull request linking back to this one for added context. Thank you! |
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,42 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
- | ||
name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.45 | ||
args: --issues-exit-code=1 | ||
- | ||
name: Import GPG key | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@v2 | ||
env: | ||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2.5.0 | ||
with: | ||
version: latest | ||
args: release --rm-dist --release-header .goreleaser.tmpl | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} |
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,25 @@ | ||
name: website-lint | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Install tools | ||
run: make tools | ||
|
||
- name: Website Lint | ||
run: make website-lint |
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