Skip to content

Commit 68382c0

Browse files
authored
Merge pull request #169 from shogo82148/introduce-flag-name
Introduce flag name
2 parents d93733f + 1441ac4 commit 68382c0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
go install .
3939
working-directory: src/github.com/mattn/goveralls
4040
- name: test
41-
run: goveralls -service=github -parallel
41+
run: goveralls -service=github -parallel -flagname="Unit-${{ matrix.os }}-Go-${{ matrix.go }}"
4242
working-directory: src/github.com/mattn/goveralls
4343
env:
4444
COVERALLS_TOKEN: ${{ github.token }}

goveralls.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ var (
6767
show = flag.Bool("show", false, "Show which package is being tested")
6868
customJobID = flag.String("jobid", "", "Custom set job token")
6969
jobNumber = flag.String("jobnumber", "", "Custom set job number")
70+
flagName = flag.String("flagname", os.Getenv("COVERALLS_FLAG_NAME"), "Job flag name, e.g. \"Unit\", \"Functional\", or \"Integration\". Will be shown in the Coveralls UI.")
7071

7172
parallelFinish = flag.Bool("parallel-finish", false, "finish parallel test")
7273
)
@@ -99,6 +100,7 @@ type Job struct {
99100
ServiceJobNumber string `json:"service_job_number,omitempty"`
100101
ServicePullRequest string `json:"service_pull_request,omitempty"`
101102
ServiceName string `json:"service_name"`
103+
FlagName string `json:"flag_name,omitempty"`
102104
SourceFiles []*SourceFile `json:"source_files"`
103105
Parallel *bool `json:"parallel,omitempty"`
104106
Git *Git `json:"git,omitempty"`
@@ -398,6 +400,7 @@ func process() error {
398400
Git: collectGitInfo(head),
399401
SourceFiles: sourceFiles,
400402
ServiceName: *service,
403+
FlagName: *flagName,
401404
}
402405

403406
// Only include a job ID if it's known, otherwise, Coveralls looks

0 commit comments

Comments
 (0)