-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*: update CI to add static tests (#428)
- Loading branch information
1 parent
c112ee3
commit b05d398
Showing
47 changed files
with
352 additions
and
138 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,13 @@ | ||
codecov: | ||
require_ci_to_pass: no | ||
notify: | ||
wait_for_ci: no | ||
|
||
coverage: | ||
round: nearest | ||
range: 30..70 | ||
|
||
ignore: | ||
- "api/types" | ||
- "pkg/models" | ||
|
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,57 @@ | ||
# Check for reproducible build | ||
|
||
name: reprotest | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# events but only for the master branch | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- release-* | ||
paths-ignore: | ||
- '**.html' | ||
- '**.md' | ||
- 'LICENSE' | ||
- 'doc/**' | ||
push: | ||
branches: | ||
- release-* | ||
paths-ignore: | ||
- '**.html' | ||
- '**.md' | ||
- 'LICENSE' | ||
- 'doc/**' | ||
|
||
jobs: | ||
reprotest: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-20.04 | ||
|
||
strategy: | ||
matrix: | ||
go: | ||
- 1.19.x | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go ${{ matrix.go }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Install reprotest and prepare | ||
id: prepare_env | ||
run: | | ||
sudo apt-get update && sudo apt-get -qy install reprotest | ||
- name: Check for reproducible build | ||
run: | | ||
sudo reprotest \ | ||
"make clean && \ | ||
PATH=$GOROOT/bin:$PATH \ | ||
BUILD_FLAGS='-trimpath -buildmode=pie -mod=readonly -modcacherw -buildvcs=false' \ | ||
make build" \ | ||
bin |
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,57 @@ | ||
--- | ||
name: static-tests | ||
|
||
on: | ||
# schedule: | ||
# # times are in UTC | ||
# - cron: '19 21 * * *' | ||
pull_request: | ||
branches: | ||
- master | ||
- release-* | ||
paths-ignore: | ||
- '**.html' | ||
- '**.md' | ||
- 'LICENSE' | ||
- 'doc/**' | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '**.html' | ||
- '**.md' | ||
- 'LICENSE' | ||
- 'doc/**' | ||
|
||
jobs: | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
env: | ||
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }} | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
path: go/src/github.com/${{ github.repository }} | ||
|
||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.19.x | ||
id: go | ||
|
||
- name: make unit-test | ||
working-directory: ${{ env.working-directory }} | ||
run: | | ||
export GOPATH=${GITHUB_WORKSPACE}/go | ||
export PATH=$PATH:$GOPATH/bin | ||
make check | ||
make test | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
working-directory: ${{ env.working-directory }} | ||
files: ./tests/cov.unit-test.out | ||
flags: unittests |
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,58 @@ | ||
ignoreGeneratedHeader = false | ||
severity = "error" | ||
confidence = 0.8 | ||
errorCode = -1 | ||
warningCode = 0 | ||
|
||
[rule.atomic] | ||
[rule.blank-imports] | ||
[rule.context-as-argument] | ||
[rule.dot-imports] | ||
[rule.duplicated-imports] | ||
[rule.error-return] | ||
[rule.error-strings] | ||
[rule.error-naming] | ||
[rule.confusing-naming] | ||
[rule.unexported-naming] | ||
[rule.confusing-results] | ||
#[rule.exported] | ||
[rule.if-return] | ||
[rule.var-declaration] | ||
[rule.var-naming] | ||
[rule.range] | ||
[rule.range-val-in-closure] | ||
[rule.range-val-address] | ||
[rule.receiver-naming] | ||
[rule.indent-error-flow] | ||
[rule.superfluous-else] | ||
[rule.modifies-parameter] | ||
[rule.modifies-value-receiver] | ||
[rule.time-naming] | ||
[rule.empty-block] | ||
[rule.empty-lines] | ||
#[rule.early-return] | ||
#[rule.unnecessary-stmt] | ||
#[rule.struct-tag] # https://github.com/mgechev/revive/issues/520 | ||
[rule.string-of-int] | ||
[rule.string-format] | ||
[rule.constant-logical-expr] | ||
[rule.bool-literal-in-expr] | ||
[rule.redefines-builtin-id] | ||
[rule.waitgroup-by-value] | ||
[rule.unconditional-recursion] | ||
|
||
[rule.cognitive-complexity] | ||
severity = "warning" | ||
arguments =[48] | ||
#[rule.cyclomatic] | ||
# severity = "warning" | ||
# arguments = [48] | ||
|
||
[imports-blacklist] | ||
arguments =["crypto/md5", "crypto/sha1", "io/ioutil"] | ||
|
||
[rule.defer] | ||
arguments=[["call-chain", "method-call", "return"]] | ||
|
||
# This can be checked by other tools like megacheck | ||
[rule.unreachable-code] |
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.