Skip to content

Commit

Permalink
chore(task): update coverage setup (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
plastikfan committed Nov 15, 2024
1 parent c3fa8e2 commit fd37249
Showing 1 changed file with 46 additions and 5 deletions.
51 changes: 46 additions & 5 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ================================================

Expand Down Expand Up @@ -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 =================================================

Expand Down

0 comments on commit fd37249

Please sign in to comment.