Skip to content

Code Analysis

Code Analysis #211

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
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@v2
with:
languages: go
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
UnitTests:
runs-on: ubuntu-latest
strategy:
matrix:
go:
- "1.18"
- "1.19"
- "1.20"
- "1.21"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
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@v3.1.4
with:
file: ./coverage.out