generated from axone-protocol/template-oss
-
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.
Merge pull request #8 from axone-protocol/ci/setup
Ci/setup
- Loading branch information
Showing
15 changed files
with
692 additions
and
2 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
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,30 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_call: | ||
|
||
push: | ||
branches: [main] | ||
|
||
pull_request: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: build-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-go: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go environment | ||
uses: actions/setup-go@v5.0.2 | ||
with: | ||
go-version: '1.21' | ||
|
||
- name: Build go project | ||
run: | | ||
make build |
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,63 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
if: github.ref == 'refs/heads/main' && github.actor == 'bot-anik' | ||
uses: ./.github/workflows/lint.yml | ||
|
||
build: | ||
if: github.ref == 'refs/heads/main' && github.actor == 'bot-anik' | ||
uses: ./.github/workflows/build.yml | ||
|
||
test: | ||
if: github.ref == 'refs/heads/main' && github.actor == 'bot-anik' | ||
uses: ./.github/workflows/test.yml | ||
|
||
perfom-release: | ||
if: github.ref == 'refs/heads/main' && github.actor == 'bot-anik' | ||
needs: | ||
- lint | ||
- build | ||
- test | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.OPS_TOKEN }} | ||
|
||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
with: | ||
gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.BOT_GPG_PASSPHRASE }} | ||
git_config_global: true | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Release project | ||
uses: cycjimmy/semantic-release-action@v4 | ||
with: | ||
semantic_version: 22.0.5 | ||
branch: main | ||
extra_plugins: | | ||
@semantic-release/changelog | ||
@semantic-release/exec | ||
@semantic-release/git | ||
semantic-release-replace-plugin@1.2.7 | ||
extends: | | ||
conventional-changelog-conventionalcommits@7.0.1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.OPS_TOKEN }} | ||
GIT_AUTHOR_NAME: ${{ vars.BOT_GIT_AUTHOR_NAME }} | ||
GIT_AUTHOR_EMAIL: ${{ vars.BOT_GIT_AUTHOR_EMAIL }} | ||
GIT_COMMITTER_NAME: ${{ vars.BOT_GIT_COMMITTER_NAME }} | ||
GIT_COMMITTER_EMAIL: ${{ vars.BOT_GIT_COMMITTER_EMAIL }} |
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,60 @@ | ||
name: Test | ||
|
||
on: | ||
workflow_call: | ||
|
||
push: | ||
branches: [main] | ||
|
||
pull_request: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: test-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-tests: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
status: ${{ steps.changed-files.outputs.any_changed == 'true' }} | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Search for all modified files that involve the execution of tests | ||
id: changed-files | ||
uses: tj-actions/changed-files@v44.5.7 | ||
with: | ||
files: | | ||
**/*.go | ||
go.mod | ||
go.sum | ||
Makefile | ||
test-go: | ||
runs-on: ubuntu-22.04 | ||
needs: check-tests | ||
if: needs.check-tests.outputs.status | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go environment | ||
uses: actions/setup-go@v5.0.2 | ||
with: | ||
go-version: "1.21" | ||
|
||
- name: Test go project | ||
run: | | ||
make test-go | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v4 | ||
if: github.actor != 'dependabot[bot]' | ||
with: | ||
files: ./target/coverage.txt | ||
env_vars: OS,GOLANG | ||
fail_ci_if_error: false | ||
verbose: true | ||
token: ${{ secrets.CODECOV_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,99 @@ | ||
run: | ||
timeout: 10m | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- asciicheck | ||
- bidichk | ||
- bodyclose | ||
- cyclop | ||
- dupl | ||
- durationcheck | ||
- errcheck | ||
- errname | ||
- errorlint | ||
- exhaustive | ||
- exportloopref | ||
- forbidigo | ||
- funlen | ||
- gci | ||
- gocognit | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- godot | ||
- goimports | ||
- gomodguard | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- lll | ||
- makezero | ||
- nakedret | ||
- nestif | ||
- nilerr | ||
- nilnil | ||
- noctx | ||
- nolintlint | ||
- prealloc | ||
- predeclared | ||
- promlinter | ||
- revive | ||
- staticcheck | ||
- stylecheck | ||
- tagliatelle | ||
- tenv | ||
- tparallel | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- wastedassign | ||
- whitespace | ||
|
||
linters-settings: | ||
cyclop: | ||
max-complexity: 20 | ||
skip-tests: true | ||
funlen: | ||
statements: 65 | ||
godot: | ||
scope: declarations # comments to be checked: `declarations` (default), `toplevel`, or `all` | ||
lll: | ||
line-length: 135 | ||
tagliatelle: | ||
case: | ||
use-field-name: true | ||
rules: | ||
json: snake | ||
yaml: snake | ||
output: | ||
uniq-by-line: false | ||
|
||
issues: | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
exclude-rules: | ||
- source: "^//\\s*go:generate\\s" | ||
linters: | ||
- lll | ||
- source: "(noinspection|TODO)" | ||
linters: | ||
- godot | ||
- source: "//noinspection" | ||
linters: | ||
- gocritic | ||
- source: "^\\s+if _, ok := err\\.\\([^.]+\\.InternalError\\); ok {" | ||
linters: | ||
- errorlint | ||
- path: "_test\\.go" | ||
linters: | ||
- dupl | ||
- funlen | ||
- path: "_test\\.go" | ||
linters: | ||
- revive | ||
text: "dot-imports:" |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
line-length: false | ||
no-hard-tabs: false | ||
first-line-h1: false | ||
no-inline-html: false |
Oops, something went wrong.