Skip to content

Commit

Permalink
use matrix for modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ktong committed Feb 4, 2024
1 parent 05d7e7e commit 069f270
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 34 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:

jobs:
benchmark:
strategy:
matrix:
module: [ '', 'provider/file', 'provider/pflag' ]
name: Benchmark
runs-on: ubuntu-latest
steps:
Expand All @@ -18,10 +21,5 @@ jobs:
go-version: 'stable'
cache-dependency-path: "**/go.sum"
- name: Benchmark
run: go test -v -shuffle=on -bench=. ./...
- name: Benchmark (file)
run: go test -v -bench=. ./...
working-directory: provider/file
- name: Benchmark (pflag)
run: go test -v -shuffle=on -bench=. ./...
working-directory: provider/pflag
working-directory: ${{ matrix.module }}
13 changes: 5 additions & 8 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:

jobs:
coverage:
benchmark:
strategy:
matrix:
module: [ '', 'provider/file', 'provider/pflag' ]
name: Coverage
runs-on: ubuntu-latest
steps:
Expand All @@ -19,11 +23,4 @@ jobs:
cache-dependency-path: "**/go.sum"
- name: Coverage
run: go test -v -covermode=count -coverprofile=coverage.txt ./...
- name: Coverage (file)
run: go test -v -covermode=count -coverprofile=coverage.txt ./...
working-directory: provider/file
- name: Coverage (pflag)
run: go test -v -covermode=count -coverprofile=coverage.txt ./...
working-directory: provider/pflag
- name: Codecov
uses: codecov/codecov-action@v4
working-directory: ${{ matrix.module }}
12 changes: 5 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:

jobs:
lint:
benchmark:
strategy:
matrix:
module: [ '', 'provider/file', 'provider/pflag' ]
name: Lint
runs-on: ubuntu-latest
steps:
Expand All @@ -19,11 +23,5 @@ jobs:
cache-dependency-path: "**/go.sum"
- name: Lint
uses: golangci/golangci-lint-action@v3
- name: Lint (file)
uses: golangci/golangci-lint-action@v3
with:
working-directory: provider/file
- name: Lint (pflag)
uses: golangci/golangci-lint-action@v3
with:
working-directory: provider/pflag
working-directory: ${{ matrix.module }}
15 changes: 3 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
test:
strategy:
matrix:
module: [ '', 'provider/file', 'provider/pflag' ]
run-on: [ 'ubuntu', 'macOS', 'windows' ]
go-version: [ 'stable' ]
name: Test
Expand All @@ -23,20 +24,10 @@ jobs:
cache-dependency-path: "**/go.sum"
- name: Race Test
run: go test -v -shuffle=on -count=10 -race ./...
working-directory: ${{ matrix.module }}
- name: Test
run: go test -v -shuffle=on ./...
- name: Race Test (file)
run: go test -v -shuffle=on -count=10 -race ./...
working-directory: provider/file
- name: Test (file)
run: go test -v ./...
working-directory: provider/file
- name: Race Test (pflag)
run: go test -v -shuffle=on -count=10 -race ./...
working-directory: provider/pflag
- name: Test (pflag)
run: go test -v -shuffle=on ./...
working-directory: provider/pflag
working-directory: ${{ matrix.module }}
all:
if: ${{ always() }}
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion provider/pflag/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/nil-go/konf/provider/pflag

go 1.19
go 1.21

require github.com/spf13/pflag v1.0.5

0 comments on commit 069f270

Please sign in to comment.