diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5c3aeb18..49056676 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,4 +42,7 @@ jobs: - uses: hetznercloud/tps-action@main + - run: echo "PACKER_PLUGIN_DIR=%APPDATA%\packer.d\plugins" >> $GITHUB_ENV + if: runner.os == 'Windows' + - run: make testacc diff --git a/GNUmakefile b/GNUmakefile index 41d80767..7ba6d501 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,5 +1,6 @@ NAME=hcloud BINARY=packer-plugin-${NAME} +PACKER_PLUGIN_DIR=~/.config/packer/plugins COUNT?=1 TEST?=./... @@ -8,27 +9,28 @@ HASHICORP_PACKER_PLUGIN_SDK_VERSION?=$(shell go list -m github.com/hashicorp/pac .PHONY: dev build: - @go build -o ${BINARY} + go build -o ${BINARY} dev: build - @mkdir -p ~/.config/packer/plugins - @mv ${BINARY} ~/.config/packer/plugins/${BINARY} + mkdir -p ${PACKER_PLUGIN_DIR} + mv ${BINARY} ${PACKER_PLUGIN_DIR} + ls ${PACKER_PLUGIN_DIR} test: - @go test -race -count $(COUNT) -v $(TEST) -timeout=3m + go test -race -count $(COUNT) -v $(TEST) -timeout=3m -install-packer-sdc: ## Install packer sofware development command - @go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@${HASHICORP_PACKER_PLUGIN_SDK_VERSION} +install-packer-sdc: ## Install packer software development command + go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@${HASHICORP_PACKER_PLUGIN_SDK_VERSION} plugin-check: install-packer-sdc build - @packer-sdc plugin-check ${BINARY} + packer-sdc plugin-check ${BINARY} -testacc: build - @PACKER_ACC=1 go test -count $(COUNT) -v $(TEST) -timeout=120m -tags=acceptance +testacc: dev + PACKER_ACC=1 go test -count $(COUNT) -v $(TEST) -timeout=120m -tags=acceptance generate: install-packer-sdc - @go generate ./... - @rm -rf .docs - @packer-sdc renderdocs -src "docs" -partials docs-partials/ -dst ".docs/" - @./.web-docs/scripts/compile-to-webdocs.sh "." ".docs" ".web-docs" "hashicorp" - @rm -r ".docs" + go generate ./... + rm -rf .docs + packer-sdc renderdocs -src "docs" -partials docs-partials/ -dst ".docs/" + ./.web-docs/scripts/compile-to-webdocs.sh "." ".docs" ".web-docs" "hashicorp" + rm -r ".docs"