mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-07-01 02:52:58 +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**
|
||||
Add any other context about the problem here.
|
||||
- Single or clustered Proxmox:
|
||||
- Provider version (ideally it should be the latest version):
|
||||
- Terraform version:
|
||||
- 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.
|
||||
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 templates in `/examples` for any new or updated resources / data sources.
|
||||
- [ ] I have ran `make examples` to verify that the change works as expected.
|
||||
- [ ] I have added / updated templates in `/example` for any new or updated resources / data sources.
|
||||
- [ ] I have ran `make example` to verify that the change works as expected.
|
||||
|
||||
<!--- Please keep this note for the community --->
|
||||
### Community Note
|
||||
|
3
.github/workflows/semgrep.yml
vendored
3
.github/workflows/semgrep.yml
vendored
@ -3,7 +3,6 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
paths:
|
||||
- .github/workflows/semgrep.yml
|
||||
schedule:
|
||||
@ -13,7 +12,7 @@ name: Semgrep
|
||||
jobs:
|
||||
semgrep:
|
||||
name: Scan
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
|
||||
container:
|
||||
|
26
.github/workflows/test.yml
vendored
26
.github/workflows/test.yml
vendored
@ -31,27 +31,10 @@ jobs:
|
||||
- name: Build
|
||||
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:
|
||||
name: Matrix Test
|
||||
name: Unit Tests
|
||||
needs: build
|
||||
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:
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
@ -65,13 +48,6 @@ jobs:
|
||||
- name: Get dependencies
|
||||
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
|
||||
timeout-minutes: 10
|
||||
run: go test -v -cover ./...
|
||||
|
22
Makefile
22
Makefile
@ -19,18 +19,22 @@ TERRAFORM_PLUGIN_EXECUTABLE_EXAMPLE=$(TERRAFORM_PLUGIN_OUTPUT_DIRECTORY)/$(NAME)
|
||||
|
||||
default: build
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf ./dist
|
||||
rm -rf ./cache
|
||||
rm -rf ./build
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
mkdir -p "$(TERRAFORM_PLUGIN_OUTPUT_DIRECTORY)"
|
||||
rm -f "$(TERRAFORM_PLUGIN_EXECUTABLE)"
|
||||
go build -o "$(TERRAFORM_PLUGIN_EXECUTABLE)"
|
||||
|
||||
.PHONY: example
|
||||
example: example-build example-init example-apply example-destroy
|
||||
|
||||
.PHONY: example-apply
|
||||
example-apply:
|
||||
export TF_CLI_CONFIG_FILE="$(shell pwd -P)/example.tfrc" \
|
||||
&& export TF_DISABLE_CHECKPOINT="true" \
|
||||
@ -38,11 +42,13 @@ example-apply:
|
||||
&& cd ./example \
|
||||
&& terraform apply -auto-approve
|
||||
|
||||
.PHONY: example-build
|
||||
example-build:
|
||||
mkdir -p "$(TERRAFORM_PLUGIN_OUTPUT_DIRECTORY)"
|
||||
rm -rf "$(TERRAFORM_PLUGIN_EXECUTABLE_EXAMPLE)"
|
||||
go build -o "$(TERRAFORM_PLUGIN_EXECUTABLE_EXAMPLE)"
|
||||
|
||||
.PHONY: example-destroy
|
||||
example-destroy:
|
||||
export TF_CLI_CONFIG_FILE="$(shell pwd -P)/example.tfrc" \
|
||||
&& export TF_DISABLE_CHECKPOINT="true" \
|
||||
@ -50,6 +56,7 @@ example-destroy:
|
||||
&& cd ./example \
|
||||
&& terraform destroy -auto-approve
|
||||
|
||||
.PHONY: example-init
|
||||
example-init:
|
||||
export TF_CLI_CONFIG_FILE="$(shell pwd -P)/example.tfrc" \
|
||||
&& export TF_DISABLE_CHECKPOINT="true" \
|
||||
@ -58,6 +65,7 @@ example-init:
|
||||
&& rm -f .terraform.lock.hcl \
|
||||
&& terraform init
|
||||
|
||||
.PHONY: example-plan
|
||||
example-plan:
|
||||
export TF_CLI_CONFIG_FILE="$(shell pwd -P)/example.tfrc" \
|
||||
&& export TF_DISABLE_CHECKPOINT="true" \
|
||||
@ -65,27 +73,39 @@ example-plan:
|
||||
&& cd ./example \
|
||||
&& terraform plan
|
||||
|
||||
.PHONY: fmt
|
||||
fmt:
|
||||
gofmt -s -w $(GOFMT_FILES)
|
||||
|
||||
.PHONY: init
|
||||
init:
|
||||
go get ./...
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
go test ./...
|
||||
|
||||
.PHONY: testacc
|
||||
testacc:
|
||||
TF_ACC=1 go test ./...
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
go run -modfile=tools/go.mod github.com/golangci/golangci-lint/cmd/golangci-lint run --fix
|
||||
|
||||
.PHONY: release-build
|
||||
release-build:
|
||||
go run -modfile=tools/go.mod github.com/goreleaser/goreleaser build --clean --skip-validate
|
||||
|
||||
.PHONY: docs
|
||||
docs:
|
||||
@mkdir -p ./build/docs-gen
|
||||
@cd ./tools && go generate tools.go
|
||||
|
||||
.PHONY: targets
|
||||
targets: $(TARGETS)
|
||||
|
||||
.PHONY: $(TARGETS)
|
||||
$(TARGETS):
|
||||
GOOS=$@ GOARCH=amd64 CGO_ENABLED=0 go build \
|
||||
-o "dist/$@/$(NAME)_v$(VERSION)-custom" \
|
||||
@ -93,5 +113,3 @@ $(TARGETS):
|
||||
zip \
|
||||
-j "dist/$(NAME)_v$(VERSION)-custom_$@_amd64.zip" \
|
||||
"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