Code Analysis #285
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: "Code Analysis" | |
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: "0 0 * * 0" | |
env: | |
GO: 1.17 | |
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 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO }} | |
- name: Run Unit Tests | |
run: go test -race -cover -coverprofile=coverage.out -covermode=atomic | |
- name: Codecov | |
uses: codecov/[email protected] | |
with: | |
file: ./coverage.out | |
GolangCI-Lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO }} | |
- name: Run GolangCi-Lint | |
uses: golangci/[email protected] | |
with: | |
version: latest |