Skip to content

Code Analysis

Code Analysis #278

Workflow file for this run

name: "Code Analysis"
on:
push:
tags:
- v*
branches:
- main
- v*
pull_request:
schedule:
- cron: "0 0 * * 0"
concurrency:
group: ${{ format('{0}-{1}', github.workflow, github.head_ref) }}
cancel-in-progress: true
jobs:
CodeQL:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: go
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
UnitTests:
runs-on: ubuntu-latest
strategy:
matrix:
go:
- "1.20"
- "1.21"
- "1.22"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: gofmt
run: diff -u <(echo -n) <(gofmt -l . )
- name: go vet
run: go vet ./...
- name: fieldalignment
run: go vet -vettool=$(which fieldalignment) ./...
- name: Run Unit Tests
run: go test -race -cover -coverprofile=coverage.out -covermode=atomic ./...
- name: Codecov
uses: codecov/codecov-action@v4.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./coverage.out