From 7cff283001c8e8f1c9f6a6a26b6106e8d2cdee8e Mon Sep 17 00:00:00 2001 From: Holger Obermaier <40787752+ho-ob@users.noreply.github.com> Date: Fri, 23 Jan 2026 14:39:39 +0100 Subject: [PATCH] Update ci (#192) Add static analysis with GolangCI-Lint, govet and staticcheck --- .github/workflows/runonce.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/runonce.yml b/.github/workflows/runonce.yml index 14e498c..f5ce3fa 100644 --- a/.github/workflows/runonce.yml +++ b/.github/workflows/runonce.yml @@ -31,12 +31,47 @@ jobs: go-version: 'stable' check-latest: true + - name: Install reviewdog + run: | + go install github.com/reviewdog/reviewdog/cmd/reviewdog@latest + + # See: https://staticcheck.io + - name: Install staticcheck + run: | + go install honnef.co/go/tools/cmd/staticcheck@latest + + # See: https://golangci-lint.run + - name: Install GolangCI-Lint + run: | + go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest + - name: Build MetricCollector run: make - name: Run MetricCollector once run: ./cc-metric-collector --once --config .github/ci-config.json + # Running the linter requires likwid.h, which gets downloaded in the build step + - name: Static Analysis with GolangCI-Lint and Upload Report with reviewdog + run: | + golangci-lint run | reviewdog -f=golangci-lint -name "Check golangci-lint on build-latest" -reporter=github-check -filter-mode=nofilter -fail-level none + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Running the linter requires likwid.h, which gets downloaded in the build step + - name: Run Static Analysis with go vet and Upload Report with reviewdog + run: | + go vet ./... | reviewdog -f=govet -name "Check govet on build-latest" -reporter=github-check -filter-mode=nofilter -fail-level none + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Running the linter requires likwid.h, which gets downloaded in the build step + - name: Run Static Analysis with staticcheck and Upload Report with reviewdog + run: | + staticcheck ./... | reviewdog -f=staticcheck -name "Check staticcheck on build-latest" -reporter=github-check -filter-mode=nofilter -fail-level none + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # # Build on AlmaLinux 8 using go-toolset #