Fix linter errors #402
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Golang CI" | |
on: | |
push: { } | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
matrix-prep: | |
runs-on: ubuntu-latest | |
outputs: | |
paths: '["configloader","pkg", "telemetry"]' | |
steps: | |
- run: echo "Preparing matrix" | |
golang-ci: | |
needs: matrix-prep | |
name: "Lint Modules" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
path: ${{ fromJson(needs.matrix-prep.outputs.paths) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.23" | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.60.3 | |
working-directory: ${{ matrix.path }} | |
args: --out-format line-number --color never -v ./... | |
gotest: | |
needs: matrix-prep | |
name: "Test Modules" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
path: ${{ fromJson(needs.matrix-prep.outputs.paths) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.23" | |
- name: Run tests with coverage | |
run: | | |
cd ${{ matrix.path }} | |
go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... | |
build: | |
needs: | |
- "golang-ci" | |
- "gotest" | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
- run: exit 1 | |
name: "Catch errors" | |
if: | | |
needs.golang-ci.result == 'failure' || contains(needs.*.result, 'failure') |