mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-08-23 03:48:35 +00:00
chore(ci): cleanup and update project configs (#549)
This commit is contained in:
parent
79eafe41e3
commit
edec5bfd1c
1
.github/ISSUE_TEMPLATE/bug_report.md
vendored
1
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -28,6 +28,7 @@ If applicable, add screenshots to help explain your problem.
|
|||||||
|
|
||||||
**Additional context**
|
**Additional context**
|
||||||
Add any other context about the problem here.
|
Add any other context about the problem here.
|
||||||
|
- Single or clustered Proxmox:
|
||||||
- Provider version (ideally it should be the latest version):
|
- Provider version (ideally it should be the latest version):
|
||||||
- Terraform version:
|
- Terraform version:
|
||||||
- OS (where you run Terraform from):
|
- OS (where you run Terraform from):
|
||||||
|
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -2,8 +2,8 @@
|
|||||||
Please mark the following items with an [x] if they apply to your PR.
|
Please mark the following items with an [x] if they apply to your PR.
|
||||||
Leave the [ ] if they are not applicable, or if you have not completed the item.
|
Leave the [ ] if they are not applicable, or if you have not completed the item.
|
||||||
- [ ] I have added / updated documentation in `/docs` for any user-facing features or additions.
|
- [ ] I have added / updated documentation in `/docs` for any user-facing features or additions.
|
||||||
- [ ] I have added / updated templates in `/examples` for any new or updated resources / data sources.
|
- [ ] I have added / updated templates in `/example` for any new or updated resources / data sources.
|
||||||
- [ ] I have ran `make examples` to verify that the change works as expected.
|
- [ ] I have ran `make example` to verify that the change works as expected.
|
||||||
|
|
||||||
<!--- Please keep this note for the community --->
|
<!--- Please keep this note for the community --->
|
||||||
### Community Note
|
### Community Note
|
||||||
|
3
.github/workflows/semgrep.yml
vendored
3
.github/workflows/semgrep.yml
vendored
@ -3,7 +3,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- master
|
|
||||||
paths:
|
paths:
|
||||||
- .github/workflows/semgrep.yml
|
- .github/workflows/semgrep.yml
|
||||||
schedule:
|
schedule:
|
||||||
@ -13,7 +12,7 @@ name: Semgrep
|
|||||||
jobs:
|
jobs:
|
||||||
semgrep:
|
semgrep:
|
||||||
name: Scan
|
name: Scan
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
|
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
|
||||||
container:
|
container:
|
||||||
|
26
.github/workflows/test.yml
vendored
26
.github/workflows/test.yml
vendored
@ -31,27 +31,10 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: go vet . && go build -v .
|
run: go vet . && go build -v .
|
||||||
|
|
||||||
# Very noisy, temporarily disabled
|
|
||||||
# - name: Run coverage
|
|
||||||
# run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
|
|
||||||
#
|
|
||||||
# - name: Upload coverage to Codecov
|
|
||||||
# uses: codecov/codecov-action@v3
|
|
||||||
|
|
||||||
# run acceptance tests in a matrix with Terraform core versions
|
|
||||||
test:
|
test:
|
||||||
name: Matrix Test
|
name: Unit Tests
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
# list whatever Terraform versions here you would like to support
|
|
||||||
terraform:
|
|
||||||
- '1.2.9'
|
|
||||||
- '1.3.8'
|
|
||||||
- '1.4.2'
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
@ -65,13 +48,6 @@ jobs:
|
|||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: go mod download
|
run: go mod download
|
||||||
|
|
||||||
# - name: TF acceptance tests
|
|
||||||
# timeout-minutes: 10
|
|
||||||
# env:
|
|
||||||
# TF_ACC: "1"
|
|
||||||
# TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
|
|
||||||
# run: go test -v -cover ./...
|
|
||||||
|
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
run: go test -v -cover ./...
|
run: go test -v -cover ./...
|
||||||
|
22
Makefile
22
Makefile
@ -19,18 +19,22 @@ TERRAFORM_PLUGIN_EXECUTABLE_EXAMPLE=$(TERRAFORM_PLUGIN_OUTPUT_DIRECTORY)/$(NAME)
|
|||||||
|
|
||||||
default: build
|
default: build
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf ./dist
|
rm -rf ./dist
|
||||||
rm -rf ./cache
|
rm -rf ./cache
|
||||||
rm -rf ./build
|
rm -rf ./build
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
mkdir -p "$(TERRAFORM_PLUGIN_OUTPUT_DIRECTORY)"
|
mkdir -p "$(TERRAFORM_PLUGIN_OUTPUT_DIRECTORY)"
|
||||||
rm -f "$(TERRAFORM_PLUGIN_EXECUTABLE)"
|
rm -f "$(TERRAFORM_PLUGIN_EXECUTABLE)"
|
||||||
go build -o "$(TERRAFORM_PLUGIN_EXECUTABLE)"
|
go build -o "$(TERRAFORM_PLUGIN_EXECUTABLE)"
|
||||||
|
|
||||||
|
.PHONY: example
|
||||||
example: example-build example-init example-apply example-destroy
|
example: example-build example-init example-apply example-destroy
|
||||||
|
|
||||||
|
.PHONY: example-apply
|
||||||
example-apply:
|
example-apply:
|
||||||
export TF_CLI_CONFIG_FILE="$(shell pwd -P)/example.tfrc" \
|
export TF_CLI_CONFIG_FILE="$(shell pwd -P)/example.tfrc" \
|
||||||
&& export TF_DISABLE_CHECKPOINT="true" \
|
&& export TF_DISABLE_CHECKPOINT="true" \
|
||||||
@ -38,11 +42,13 @@ example-apply:
|
|||||||
&& cd ./example \
|
&& cd ./example \
|
||||||
&& terraform apply -auto-approve
|
&& terraform apply -auto-approve
|
||||||
|
|
||||||
|
.PHONY: example-build
|
||||||
example-build:
|
example-build:
|
||||||
mkdir -p "$(TERRAFORM_PLUGIN_OUTPUT_DIRECTORY)"
|
mkdir -p "$(TERRAFORM_PLUGIN_OUTPUT_DIRECTORY)"
|
||||||
rm -rf "$(TERRAFORM_PLUGIN_EXECUTABLE_EXAMPLE)"
|
rm -rf "$(TERRAFORM_PLUGIN_EXECUTABLE_EXAMPLE)"
|
||||||
go build -o "$(TERRAFORM_PLUGIN_EXECUTABLE_EXAMPLE)"
|
go build -o "$(TERRAFORM_PLUGIN_EXECUTABLE_EXAMPLE)"
|
||||||
|
|
||||||
|
.PHONY: example-destroy
|
||||||
example-destroy:
|
example-destroy:
|
||||||
export TF_CLI_CONFIG_FILE="$(shell pwd -P)/example.tfrc" \
|
export TF_CLI_CONFIG_FILE="$(shell pwd -P)/example.tfrc" \
|
||||||
&& export TF_DISABLE_CHECKPOINT="true" \
|
&& export TF_DISABLE_CHECKPOINT="true" \
|
||||||
@ -50,6 +56,7 @@ example-destroy:
|
|||||||
&& cd ./example \
|
&& cd ./example \
|
||||||
&& terraform destroy -auto-approve
|
&& terraform destroy -auto-approve
|
||||||
|
|
||||||
|
.PHONY: example-init
|
||||||
example-init:
|
example-init:
|
||||||
export TF_CLI_CONFIG_FILE="$(shell pwd -P)/example.tfrc" \
|
export TF_CLI_CONFIG_FILE="$(shell pwd -P)/example.tfrc" \
|
||||||
&& export TF_DISABLE_CHECKPOINT="true" \
|
&& export TF_DISABLE_CHECKPOINT="true" \
|
||||||
@ -58,6 +65,7 @@ example-init:
|
|||||||
&& rm -f .terraform.lock.hcl \
|
&& rm -f .terraform.lock.hcl \
|
||||||
&& terraform init
|
&& terraform init
|
||||||
|
|
||||||
|
.PHONY: example-plan
|
||||||
example-plan:
|
example-plan:
|
||||||
export TF_CLI_CONFIG_FILE="$(shell pwd -P)/example.tfrc" \
|
export TF_CLI_CONFIG_FILE="$(shell pwd -P)/example.tfrc" \
|
||||||
&& export TF_DISABLE_CHECKPOINT="true" \
|
&& export TF_DISABLE_CHECKPOINT="true" \
|
||||||
@ -65,27 +73,39 @@ example-plan:
|
|||||||
&& cd ./example \
|
&& cd ./example \
|
||||||
&& terraform plan
|
&& terraform plan
|
||||||
|
|
||||||
|
.PHONY: fmt
|
||||||
fmt:
|
fmt:
|
||||||
gofmt -s -w $(GOFMT_FILES)
|
gofmt -s -w $(GOFMT_FILES)
|
||||||
|
|
||||||
|
.PHONY: init
|
||||||
init:
|
init:
|
||||||
go get ./...
|
go get ./...
|
||||||
|
|
||||||
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
go test ./...
|
go test ./...
|
||||||
|
|
||||||
|
.PHONY: testacc
|
||||||
|
testacc:
|
||||||
|
TF_ACC=1 go test ./...
|
||||||
|
|
||||||
|
.PHONY: lint
|
||||||
lint:
|
lint:
|
||||||
go run -modfile=tools/go.mod github.com/golangci/golangci-lint/cmd/golangci-lint run --fix
|
go run -modfile=tools/go.mod github.com/golangci/golangci-lint/cmd/golangci-lint run --fix
|
||||||
|
|
||||||
|
.PHONY: release-build
|
||||||
release-build:
|
release-build:
|
||||||
go run -modfile=tools/go.mod github.com/goreleaser/goreleaser build --clean --skip-validate
|
go run -modfile=tools/go.mod github.com/goreleaser/goreleaser build --clean --skip-validate
|
||||||
|
|
||||||
|
.PHONY: docs
|
||||||
docs:
|
docs:
|
||||||
@mkdir -p ./build/docs-gen
|
@mkdir -p ./build/docs-gen
|
||||||
@cd ./tools && go generate tools.go
|
@cd ./tools && go generate tools.go
|
||||||
|
|
||||||
|
.PHONY: targets
|
||||||
targets: $(TARGETS)
|
targets: $(TARGETS)
|
||||||
|
|
||||||
|
.PHONY: $(TARGETS)
|
||||||
$(TARGETS):
|
$(TARGETS):
|
||||||
GOOS=$@ GOARCH=amd64 CGO_ENABLED=0 go build \
|
GOOS=$@ GOARCH=amd64 CGO_ENABLED=0 go build \
|
||||||
-o "dist/$@/$(NAME)_v$(VERSION)-custom" \
|
-o "dist/$@/$(NAME)_v$(VERSION)-custom" \
|
||||||
@ -93,5 +113,3 @@ $(TARGETS):
|
|||||||
zip \
|
zip \
|
||||||
-j "dist/$(NAME)_v$(VERSION)-custom_$@_amd64.zip" \
|
-j "dist/$(NAME)_v$(VERSION)-custom_$@_amd64.zip" \
|
||||||
"dist/$@/$(NAME)_v$(VERSION)-custom"
|
"dist/$@/$(NAME)_v$(VERSION)-custom"
|
||||||
|
|
||||||
.PHONY: clean build example example-apply example-destroy example-init example-plan fmt init targets test docs $(TARGETS)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user