diff --git a/.github/workflows/lint-test-code.yaml b/.github/workflows/lint-test-code.yaml index d7e66363..3237fda7 100644 --- a/.github/workflows/lint-test-code.yaml +++ b/.github/workflows/lint-test-code.yaml @@ -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: | @@ -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 @@ -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 diff --git a/Justfile b/Justfile index bcd8a220..27209a43 100644 --- a/Justfile +++ b/Justfile @@ -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" @@ -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 @@ -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