Skip to content

Commit 9a9922a

Browse files
committed
test all modules
1 parent 945f697 commit 9a9922a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/build-and-release.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ jobs:
100100
# scan-codeql,
101101
# scan-intermediate-image
102102
]
103+
strategy:
104+
matrix:
105+
module:
106+
- "."
107+
- "./api"
108+
- "./pkg/cluster-handler"
109+
- "./pkg/data-handler"
110+
- "./pkg/resource-handler"
103111
runs-on: ubuntu-latest
104112
steps:
105113
- name: Check out code
@@ -108,19 +116,23 @@ jobs:
108116
- name: Install Go
109117
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
110118
with:
111-
go-version-file: go.mod
119+
go-version-file: ${{ matrix.module }}/go.mod
112120

113121
- name: Run linter
114122
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
123+
with:
124+
working-directory: ${{ matrix.module }}
125+
args: --config=${{ github.workspace }}/.golangci.toml
115126

116127
- name: Run tests
117128
run: |-
129+
cd ${{ matrix.module}}
118130
go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
119131
120132
# - name: Check test coverage
121133
# uses: vladopajic/go-test-coverage@cc5012c2cfa84542e02b079141958a885861d326 # v2.17.0
122134
# with:
123-
# config: ./.testcoverage.yml
135+
# config: ${{ matrix.module }}/.testcoverage.yml
124136

125137
build-scan-push-container:
126138
needs: [ test-go ]

0 commit comments

Comments
 (0)