Skip to content

Code Analysis

Code Analysis #396

Workflow file for this run

name: "Code Analysis"
on:
push:
tags:
- v*
branches:
- main
pull_request:
schedule:
- cron: "0 0 * * 0"
concurrency:
group: ${{ format('{0}-{1}', github.workflow, github.head_ref) }}
cancel-in-progress: true
permissions: read-all
jobs:
UnitTests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.5.0
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: go.mod
- run: go test -race -cover -coverprofile=coverage.out -covermode=atomic
- run: go test -json 2>&1 | go tool -modfile=".github/tools/go.mod" go-junit-report -parser gojson > junit.xml
if: always()
- name: Upload coverage reports to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.5.0
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: go.mod
- name: Verify Config
run: go tool -modfile=".github/tools/go.mod" golangci-lint config verify --verbose
- name: Run Linter
run: go tool -modfile=".github/tools/go.mod" golangci-lint run --verbose