-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To ensure that 'make docs' functionality does not break.
- Loading branch information
1 parent
7c24c5e
commit 8107830
Showing
2 changed files
with
39 additions
and
9 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,28 @@ | ||
# Copyright 2024 Hewlett Packard Enterprise Development LP | ||
name: Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
docs: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.22.3' | ||
- uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_version: 1.9.5 | ||
# set wrapper to false, otherwise any time | ||
# terraform is run the first line of stdout is | ||
# the path to the terraform binary. This causes | ||
# eg the output of "terraform providers schema -json" | ||
# be unusable | ||
terraform_wrapper: false | ||
- run: make install-experimental | ||
- run: go install github.com/hashicorp/terraform-plugin-docs/cmd/[email protected] | ||
- run: make docs |
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 |
---|---|---|
|
@@ -26,12 +26,14 @@ install-experimental: | |
go install -tags experimental ./... | ||
|
||
docs: | ||
echo -e ${PROVIDER_TF} > __docs.tf; \ | ||
tempfile=$$(mktemp); \ | ||
terraform providers schema -json | \ | ||
sed '[email protected]/hewlettpackard/hpegl-pcbe-terraform-resources@hpegl@g' > $$tempfile; \ | ||
tfplugindocs generate --providers-schema $$tempfile -provider-name hpegl; | ||
rm __docs.tf | ||
printf "${PROVIDER_TF}" > __docs.tf; \ | ||
tfconfig=$$(mktemp); \ | ||
sed "s@__HOME__@${HOME}@g" test/.terraformrc > $$tfconfig; \ | ||
schemafile=$$(mktemp); \ | ||
env TF_CLI_CONFIG_FILE=$$tfconfig terraform providers schema -json | \ | ||
sed '[email protected]/hewlettpackard/hpegl-pcbe-terraform-resources@hpegl@g' > $$schemafile; \ | ||
rm __docs.tf; \ | ||
tfplugindocs generate --provider-name hpegl --providers-schema $$schemafile | ||
|
||
test: | ||
go test ./... | ||
|
@@ -42,9 +44,9 @@ testacc: | |
|
||
testacc-simulation: | ||
go install -tags experimental,simulation ./cmd/... | ||
tempfile=$$(mktemp); \ | ||
sed "s@__HOME__@${HOME}@g" test/.terraformrc > $$tempfile; \ | ||
env TF_ACC=1 env TF_CLI_CONFIG_FILE=$$tempfile \ | ||
tfconfig=$$(mktemp); \ | ||
sed "s@__HOME__@${HOME}@g" test/.terraformrc > $$tfconfig; \ | ||
env TF_ACC=1 env TF_CLI_CONFIG_FILE=$$tfconfig \ | ||
go test -v -tags simulation ./test/... | ||
|
||
lint: | ||
|