-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3b9e0d
commit f1ee310
Showing
9 changed files
with
224 additions
and
10 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,24 @@ | ||
# | ||
# This codecov.yml is the default configuration for | ||
# all repositories on Codecov. You may adjust the settings | ||
# below in your own codecov.yml in your repository. | ||
# | ||
coverage: | ||
precision: 2 | ||
round: down | ||
range: 70...100 | ||
|
||
status: | ||
# Learn more at https://codecov.io/docs#yaml_default_commit_status | ||
status: #Code coverage status will be posted to pull requests based on targets defined below. | ||
diff: #diff coverage is code coverage only for the lines changed in a pull request. | ||
target: 20% | ||
|
||
project: | ||
default: | ||
threshold: 1% # allow this much decrease on project | ||
changes: false | ||
|
||
comment: | ||
layout: "header, diff, flags" | ||
behavior: default # update if exists else create new |
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,50 @@ | ||
name: Lint | ||
on: | ||
pull_request: | ||
permissions: | ||
contents: read | ||
env: | ||
GOPRIVATE: "github.com/allinbits/*" | ||
|
||
jobs: | ||
setup-matrix: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup matrix combinations | ||
id: setup-matrix-combinations | ||
run: | | ||
MATRIX_PARAMS_COMBINATIONS="$(make versions-json)" | ||
echo ::set-output name=matrix-combinations::{\"include\":$MATRIX_PARAMS_COMBINATIONS} | ||
outputs: | ||
matrix-combinations: ${{ steps.setup-matrix-combinations.outputs.matrix-combinations }} | ||
|
||
golangci: | ||
name: lint | ||
runs-on: self-hosted | ||
needs: setup-matrix | ||
strategy: | ||
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix-combinations) }} | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Configure git for private modules | ||
env: | ||
GIT_TOKEN: ${{ secrets.TENDERBOT_GIT_TOKEN }} | ||
run: git config --global url."https://git:${GIT_TOKEN}@github.com".insteadOf "https://github.com" | ||
|
||
- name: Setup multisdk | ||
run: make setup-${{ matrix.versions }} | ||
|
||
- name: golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: v1.43 | ||
args: --timeout 10m --build-tags sdk_${{ matrix.versions }} | ||
github-token: ${{ secrets.TENDERBOT_GIT_TOKEN }} |
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,55 @@ | ||
name: Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
|
||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
jobs: | ||
setup-matrix: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup matrix combinations | ||
id: setup-matrix-combinations | ||
run: | | ||
MATRIX_PARAMS_COMBINATIONS="$(make versions-json)" | ||
echo ::set-output name=matrix-combinations::{\"include\":$MATRIX_PARAMS_COMBINATIONS} | ||
outputs: | ||
matrix-combinations: ${{ steps.setup-matrix-combinations.outputs.matrix-combinations }} | ||
|
||
code_cov: | ||
runs-on: self-hosted | ||
needs: setup-matrix | ||
strategy: | ||
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix-combinations) }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Setup token for pulling from allinbits private repos | ||
run: | | ||
go env -w GOPRIVATE=github.com/allinbits/* | ||
go env -w GOPROXY=direct | ||
git config --global url."https://git:${{ secrets.TENDERBOT_GIT_TOKEN }}@github.com".insteadOf "https://github.com" | ||
- name: Setup multisdk | ||
run: make setup-${{ matrix.versions }} | ||
|
||
- name: Run Tests | ||
run: make test-${{ matrix.versions }} | ||
|
||
- name: Run coverage | ||
run: make coverage-${{ matrix.versions }} | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
file: coverage.out |
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 @@ | ||
run: | ||
tests: false | ||
timeout: 5m | ||
skip-dirs: | ||
- github.com/allinbits/starport-operator/* | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- bodyclose | ||
- deadcode | ||
- depguard | ||
- dogsled | ||
- errcheck | ||
- goconst | ||
- gocritic | ||
- gofmt | ||
- goimports | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- nakedret | ||
- prealloc | ||
- exportloopref | ||
- staticcheck | ||
- structcheck | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unused | ||
- varcheck | ||
|
||
issues: | ||
exclude-rules: | ||
- text: "ST1003:" | ||
linters: | ||
- stylecheck | ||
|
||
linters-settings: | ||
dogsled: | ||
max-blank-identifiers: 3 | ||
maligned: | ||
# print struct with more effective memory layout or not, false by default | ||
suggest-new: true | ||
golint: | ||
# minimal confidence for issues, default is 0.8 | ||
min-confidence: 0 | ||
prealloc: | ||
# XXX: we don't recommend using this linter before doing performance profiling. | ||
# For most programs usage of prealloc will be a premature optimization. | ||
|
||
# Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. | ||
# True by default. | ||
simple: false | ||
range-loops: true # Report preallocation suggestions on range loops, true by default | ||
for-loops: true # Report preallocation suggestions on for loops, false by default |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# sdk-service | ||
|
||
[![codecov](https://codecov.io/gh/allinbits/sdk-service/branch/main/graph/badge.svg?token=AXDASRALWG)](https://codecov.io/gh/allinbits/sdk-service) | ||
[![Build status](https://github.com/allinbits/sdk-service/workflows/Build/badge.svg)](https://github.com/allinbits/sdk-service/commits/main) | ||
[![Tests status](https://github.com/allinbits/sdk-service/workflows/Tests/badge.svg)](https://github.com/allinbits/sdk-service/commits/main) | ||
[![Lint](https://github.com/allinbits/sdk-service/workflows/Lint/badge.svg?token)](https://github.com/allinbits/sdk-service/commits/main) |
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