Skip to content

Commit

Permalink
move options to env
Browse files Browse the repository at this point in the history
  • Loading branch information
jptosso committed Nov 13, 2024
1 parent 2d7129e commit 5a51e8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:
cache: true
- name: Tests and coverage
run: |
go run mage.go coverage ${{ matrix.build-flag }}
export BUILD_TAGS="${{ matrix.build-flag }}"
go run mage.go coverage
- name: "Codecov: General"
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
if: ${{ matrix.go-version == '1.22.x' }}
Expand Down
6 changes: 4 additions & 2 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ func buildTagsFlags(tags string) string {
}

// Coverage runs tests with coverage and race detector enabled.
func Coverage(tags string) error {
tags = buildTagsFlags(tags)
// Usage: mage coverage [buildTags]
func Coverage() error {
buildTags := os.Getenv("BUILD_TAGS")
tags := buildTagsFlags(buildTags)
if err := os.MkdirAll("build", 0755); err != nil {
return err
}
Expand Down

0 comments on commit 5a51e8c

Please sign in to comment.