Skip to content

Commit

Permalink
ci: fix e2e tests for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
phm07 committed Nov 2, 2023
1 parent 58ca513 commit 342bbc5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 16 additions & 14 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
NAME=hcloud
BINARY=packer-plugin-${NAME}
PACKER_PLUGIN_DIR=~/.config/packer/plugins

COUNT?=1
TEST?=./...
Expand All @@ -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"

0 comments on commit 342bbc5

Please sign in to comment.