-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run linters, CodeQL and testing benchmarks for the most common scenarious. Signed-off-by: Anna Shaleva <[email protected]>
- Loading branch information
1 parent
152232a
commit 81c041b
Showing
2 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: | ||
- master | ||
types: [opened, synchronize] | ||
paths-ignore: | ||
- '**/*.md' | ||
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: 'Ref to test Bench, GoNode and SharpNode images [default: latest master; examples: 0a4ff9d3e4a9ab432fd5812eb18c98e03b5a7432]' | ||
required: false | ||
default: '' | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.19' | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.ref }} | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
working-directory: cmd | ||
|
||
codeql: | ||
name: CodeQL | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'go' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.ref }} | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
|
||
tests: | ||
name: Run tests | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
benchmarks: [ 'GoSingle10wrk', 'SharpSingle10wrk', 'MixedFourNodesGoRPC50rate' ] | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.ref }} | ||
fetch-depth: 0 | ||
|
||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Build Bench, GoNode and SharpNode docker images | ||
run: make build | ||
|
||
- name: Prepare configurations | ||
run: make prepare | ||
|
||
- name: Run benchmark for ${{ matrix.benchmarks }} | ||
run: make start.${{ matrix.benchmarks }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# This file contains all available configuration options | ||
# with their default values. | ||
|
||
# options for analysis running | ||
run: | ||
# timeout for analysis, e.g. 30s, 5m, default is 1m | ||
timeout: 5m | ||
|
||
# include test files or not, default is true | ||
tests: true | ||
|
||
# output configuration options | ||
output: | ||
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" | ||
format: tab | ||
|
||
# all available settings of specific linters | ||
linters-settings: | ||
exhaustive: | ||
# indicates that switch statements are to be considered exhaustive if a | ||
# 'default' case is present, even if all enum members aren't listed in the | ||
# switch | ||
default-signifies-exhaustive: true | ||
govet: | ||
# report about shadowed variables | ||
check-shadowing: false | ||
|
||
linters: | ||
enable: | ||
# mandatory linters | ||
- govet | ||
- revive | ||
|
||
# some default golangci-lint linters | ||
- errcheck | ||
- gosimple | ||
- godot | ||
- ineffassign | ||
- staticcheck | ||
- typecheck | ||
- unused | ||
|
||
# extra linters | ||
# - exhaustive | ||
# - goconst | ||
# - goerr113 | ||
# - gomnd | ||
# - nonamedreturns | ||
# - unparam | ||
- bidichk | ||
- bodyclose | ||
- contextcheck | ||
- decorder | ||
- durationcheck | ||
- errorlint | ||
- exportloopref | ||
- gofmt | ||
- misspell | ||
- predeclared | ||
- reassign | ||
- whitespace | ||
- goimports | ||
disable-all: true | ||
fast: false | ||
|
||
issues: | ||
include: | ||
- EXC0002 # should have a comment | ||
- EXC0003 # test/Test ... consider calling this | ||
- EXC0004 # govet | ||
- EXC0005 # C-style breaks | ||
exclude-rules: | ||
- linters: | ||
- revive | ||
text: "unused-parameter" |