Skip to content

Commit

Permalink
update recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
1riatsila1 committed Nov 1, 2024
1 parent 6d9202f commit c06ff9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint-test-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Check package files up to date
run: |
just tidy
git diff --exit-code -- pkg/config-api-client/go.* pkg/config-api-provider/go.*
git diff --exit-code -- go.* pkg/config-api-client/go.*
- name: Run Tests
run: |
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Check Provider docs up to date
run: |
just generate-provider-docs
git diff --exit-code -- pkg/config-api-provider/docs
git diff --exit-code -- docs
- name: Check Provider docs valid
run: just validate-provider-docs
Expand All @@ -60,6 +60,6 @@ jobs:
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./pkg/config-api-client/.coverage,./pkg/config-api-provider/.coverage
files: ./pkg/config-api-client/.coverage,.coverage
flage: client,provider
fail_ci_if_error: true
10 changes: 5 additions & 5 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TMP_DIR := "tmp"
CONFIG_API_CLIENT_DIR := "pkg/config-api-client"
CONFIG_API_PROVIDER_DIR := "internal"
CONFIG_API_PROVIDER_DIR := "."
TOOLS_PROVIDER_DIR := "tools"
OPENAPI_SPEC := "pkg/config-api-client/api"
SOURCE_OPEN_API_SPEC_FILE := ".openapi.source.yaml"
Expand Down Expand Up @@ -65,7 +65,7 @@ lint-client:
lint-provider:
#!/usr/bin/env bash
cd pkg/config-api-provider
cd {{ CONFIG_API_PROVIDER_DIR }}

if [ -n "$(gofmt -d .)" ]; then
echo "Error: (gofmt) formatting required" >&2
Expand All @@ -84,17 +84,17 @@ fmt-provider:
golines -w {{ CONFIG_API_PROVIDER_DIR }}

tidy-provider:
cd {{ CONFIG_API_PROVIDER_DIR }} && go mod tidy
cd {{ CONFIG_API_PROVIDER_DIR }} go mod tidy

test-provider +ARGS='':
cd {{ CONFIG_API_PROVIDER_DIR }} && TF_ACC=1 go test -v ./... -race -covermode=atomic -coverprofile=.coverage {{ ARGS }}

generate-provider-docs:
cd {{ TOOLS_PROVIDER_DIR }} && go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-dir ../{{ CONFIG_API_PROVIDER_DIR }} -provider-name uxi
cd {{ TOOLS_PROVIDER_DIR }} && go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-dir ../{{ CONFIG_API_PROVIDER_DIR }} --provider-name uxi
sed -i.backup '/subcategory: ""/d' ./{{ CONFIG_API_PROVIDER_DIR }}/docs/index.md && rm ./{{ CONFIG_API_PROVIDER_DIR }}/docs/index.md.backup

validate-provider-docs:
cd {{ TOOLS_PROVIDER_DIR }} && go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs validate --provider-dir ../{{ CONFIG_API_PROVIDER_DIR }} -provider-name uxi
cd {{ TOOLS_PROVIDER_DIR }} && go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs validate --provider-dir ../{{ CONFIG_API_PROVIDER_DIR }} --provider-name uxi

coverage-provider:
cd {{ CONFIG_API_PROVIDER_DIR }} && go tool cover -html=.coverage -o=.coverage.html
Expand Down

0 comments on commit c06ff9a

Please sign in to comment.