Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static code analysis #1

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Lint

on:
push:
branches:
- main
- master

jobs:
unit_tests:
strategy:
matrix:
go-version: [1.20.x]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- go-version: 1.17.x
os: ubuntu-latest
- go-version: 1.18.x
os: ubuntu-latest
- go-version: 1.19.x
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.54

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
#
# Note: By default, the `.golangci.yml` file should be at the root of the repository.
# The location of the configuration file can be changed by using `--config=`
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true, then all caching functionality will be completely disabled,
# takes precedence over all other caching options.
skip-cache: true

# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
skip-pkg-cache: true

# Optional: if set to true, then the action won't cache or restore ~/.cache/go-build.
skip-build-cache: true

# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
# install-mode: "goinstall"
56 changes: 56 additions & 0 deletions .github/workflows/qodana_code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Test

on: [push, pull_request]

jobs:
unit_tests:
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- go-version: 1.19.x
os: ubuntu-latest
- go-version: 1.20.x
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Make all
run: make all

- name: Make Test
run: make test
test_coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Make all
run: make all

- name: Setup
run: mkdir -p .qodana/code-coverage

- name: Make Coverage
run: make test-coverage

- name: 'Qodana Scan'
uses: JetBrains/[email protected]
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
with:
pr-mode: true
14 changes: 14 additions & 0 deletions .github/workflows/staticcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "CI"
on: ["push", "pull_request"]

jobs:
ci:
name: "Run CI"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: dominikh/[email protected]
with:
version: "2022.1.1"
8 changes: 6 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Test

on: [push, pull_request]

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
unit_tests:
strategy:
Expand All @@ -14,7 +18,7 @@ jobs:
- go-version: 1.18.x
os: ubuntu-latest
- go-version: 1.19.x
os: ubuntu-latest
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
Expand All @@ -27,6 +31,6 @@ jobs:

- name: Make all
run: make all

- name: Make Test
run: make test
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ package.json
/.vscode/
/vendor/

.fake_gopath_suffix
.fake_gopath_suffix

.idea
Loading
Loading