From 078d1a239730bd793e6e10b2831a14acf67781d0 Mon Sep 17 00:00:00 2001 From: plastikfan Date: Fri, 15 Nov 2024 08:26:54 +0000 Subject: [PATCH] chore(task): update coverage setup (#81) --- Taskfile.yml | 51 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 39356d6..33834c1 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -11,6 +11,26 @@ silent: true dotenv: [".env"] +vars: + FORMAT: json + BINARY_NAME: traverse + DEPLOY_DIR: ./locale/deploy + OUT_DIR: ./locale/out + L10N_DIR: ./locale/out/l10n + # + SOURCE_LANG: en-GB + SOURCE_ACTIVE: "active.{{.SOURCE_LANG}}.{{.FORMAT}}" + # + LANGUAGE_US: en-US + US_OUT_DIR: "{{.OUT_DIR}}/{{.LANGUAGE_US}}" + ACTIVE_US: "{{.BINARY_NAME}}.active.en-US.{{.FORMAT}}" + TRANSLATE_US: "{{.BINARY_NAME}}.translate.en-US.{{.FORMAT}}" + TRANSLATE_US_FILEPATH: "{{.US_OUT_DIR}}/{{.TRANSLATE_US}}" + COVER_DIR: "./" + COVER_FILE: "coverage.out" + COVER_HTML_PATH: "./coverage.html" + GINKGO_REPORT: "ginkgo.report" + tasks: # === build ================================================ @@ -90,16 +110,37 @@ tasks: # === coverage ============================================= - publish-cover: + cover-clean: + cmds: + - rm -rf ./coverage + + cover-publish: cmds: - goveralls -repotoken {{.COVERALLS_TOKEN}} + cover-setup: + cmds: + - mkdir -p ./coverage + + cover-ginkgo: + cmds: + - ginkgo run -r -json-report {{.GINKGO_REPORT}} -coverpkg=./... -coverprofile={{.COVER_FILE}} --output-dir {{.COVER_DIR}} + + cover-show: + cmds: + - open {{.COVER_HTML_PATH}} + + cover-exclude: + cmds: + - ./scripts/apply-coverage-exclusions.sh + cover: cmds: - - ginkgo --json-report - ./ginkgo.report - -coverpkg=./... - -coverprofile=./coverage/coverage.out -r + - task: cover-setup + - task: cover-ginkgo + - task: cover-exclude + - go tool cover -html=./coverage.out -o {{.COVER_HTML_PATH}} + - open {{.COVER_HTML_PATH}} # === i18n =================================================