Open ROCKTAKEY opened 2 years ago
(defun undercover-coveralls--update-report-with-env (report env)
"Update test coverage REPORT for coveralls.io with information from ENV."
(undercover--add-to-hash-table report
"service_name" (or
(getenv "COVERALLS_SERVICE_NAME")
(cl-case (gethash :ci-type env)
((nil)
(unless undercover-force-coverage
(error "UNDERCOVER: Failed to detect the CI service")))
(github-actions
;; When service_name is set to "github", Coveralls
;; expects "repo_token" to contain the GitHub access
;; token instead of the Coveralls repo token.
(cond
((getenv "COVERALLS_REPO_TOKEN")
"undercover-github-actions")
((getenv "GITHUB_TOKEN")
"github")))
(travis-ci
"travis-ci")
(shippable
"shippable") ; presumably
(drone
"drone")
(jenkins
"jenkins")
(circle-ci
"circleci")
(codeship
"codeship")
(wercker
"wercker")
(gitlab-ci
"gitlab-ci")
(appveyor
"appveyor")
(surf
"surf")
(buildkite
"buildkite")
(semaphore
"semaphore")
(codefresh
"Codefresh"))
(unless undercover-force-coverage
(error "UNDERCOVER: Failed to detect Coveralls service_name")))
"repo_token" (cond
((and (eq (gethash :ci-type env) 'github-actions)
(getenv "GITHUB_TOKEN"))
(getenv "GITHUB_TOKEN"))
(t
(getenv "COVERALLS_REPO_TOKEN")))
"service_number" (or
(getenv "COVERALLS_SERVICE_NUMBER")
(gethash :build-number env)
(gethash :build-id env))
"service_job_id" (or
(getenv "COVERALLS_SERVICE_JOB_ID")
(gethash :job-id env))
"service_pull_request" (or
(getenv "COVERALLS_SERVICE_PULL_REQUEST") ; Not official
(gethash :pull-request env))
"parallel" (if (getenv "COVERALLS_PARALLEL")
t
json-false)
"flag_name" (or
(getenv "COVERALLS_FLAG_NAME")
(gethash :job-name env))
"run_at" (getenv "COVERALLS_RUN_AT")
"git" (undercover--add-to-hash-table (undercover--make-hash-table)
"branch" (gethash :ref env)
"remotes" (undercover-coveralls--get-git-remotes)
"head" (undercover--make-hash-table
"id" (gethash :commit env)
"author_name" (gethash :author-name env)
"author_email" (gethash :author-email env)
"committer_name" (gethash :committer-name env)
"committer_email" (gethash :committer-email env)
"message" (gethash :subject env)))))
undercover-coveralls--update-report-with-env
is called and(gethash :ci-type env)
isgithub-actions
but it does not work.going to below: