Skip to content

Commit 88a038e

Browse files
authored
Merge pull request #1 from rollkit/tzdybal/initial_import
feat: initial import
2 parents 4dced3d + 6a422c4 commit 88a038e

16 files changed

+545
-0
lines changed

.github/auto_request_review.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
reviewers:
2+
defaults:
3+
- rollkit
4+
groups:
5+
rollkit:
6+
- team:core
7+
files:
8+
".github/**":
9+
- MSevey
10+
- rollkit
11+
options:
12+
ignore_draft: true
13+
ignored_keywords:
14+
- WIP
15+
number_of_reviewers: 3

.github/dependabot.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
labels:
9+
- T:dependencies
10+
# Group all patch updates into a single PR
11+
groups:
12+
patch-updates:
13+
applies-to: version-updates
14+
update-types:
15+
- "patch"
16+
- package-ecosystem: gomod
17+
directory: "/"
18+
schedule:
19+
interval: daily
20+
open-pull-requests-limit: 10
21+
labels:
22+
- T:dependencies
23+
# Group all patch updates into a single PR
24+
groups:
25+
patch-updates:
26+
applies-to: version-updates
27+
update-types:
28+
- "patch"
29+
- package-ecosystem: docker
30+
directory: "/"
31+
schedule:
32+
interval: daily
33+
open-pull-requests-limit: 10
34+
labels:
35+
- T:dependencies
36+
# Group all patch updates into a single PR
37+
groups:
38+
patch-updates:
39+
applies-to: version-updates
40+
update-types:
41+
- "patch"

.github/workflows/ci_release.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI and Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
# Trigger on version tags
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
merge_group:
11+
workflow_dispatch:
12+
# Inputs the workflow accepts.
13+
inputs:
14+
version:
15+
# Friendly description to be shown in the UI instead of 'name'
16+
description: "Semver type of new version (major / minor / patch)"
17+
# Input has to be provided for the workflow to run
18+
required: true
19+
type: choice
20+
options:
21+
- patch
22+
- minor
23+
- major
24+
25+
jobs:
26+
lint:
27+
uses: ./.github/workflows/lint.yml
28+
29+
test:
30+
uses: ./.github/workflows/test.yml
31+
32+
# Make a release if this is a manually trigger job, i.e. workflow_dispatch
33+
release:
34+
needs: [lint, test]
35+
runs-on: ubuntu-latest
36+
if: ${{ github.event_name == 'workflow_dispatch' }}
37+
permissions: "write-all"
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Version Release
41+
uses: rollkit/.github/.github/actions/[email protected]
42+
with:
43+
github-token: ${{secrets.GITHUB_TOKEN}}
44+
version-bump: ${{inputs.version}}

.github/workflows/housekeeping.yml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Housekeeping
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request_target:
7+
types: [opened, ready_for_review]
8+
9+
jobs:
10+
issue-management:
11+
if: ${{ github.event.issue }}
12+
name: Add issues to project and add triage label
13+
uses: rollkit/.github/.github/workflows/[email protected]
14+
secrets: inherit
15+
permissions:
16+
issues: write
17+
pull-requests: write
18+
with:
19+
run-labels: true
20+
labels-to-add: "needs-triage"
21+
run-projects: true
22+
project-url: https://github.com/orgs/rollkit/projects/7
23+
24+
add-pr-to-project:
25+
# ignore dependabot PRs
26+
if: ${{ github.event.pull_request && github.actor != 'dependabot[bot]' }}
27+
name: Add PRs to project
28+
uses: rollkit/.github/.github/workflows/[email protected]
29+
secrets: inherit
30+
permissions:
31+
issues: write
32+
pull-requests: write
33+
with:
34+
run-projects: true
35+
project-url: https://github.com/orgs/rollkit/projects/7
36+
37+
auto-add-reviewer:
38+
name: Auto add reviewer to PR
39+
if: github.event.pull_request
40+
uses: rollkit/.github/.github/workflows/[email protected]
41+
secrets: inherit
42+
permissions:
43+
issues: write
44+
pull-requests: write
45+
with:
46+
run-auto-request-review: true
47+
48+
auto-add-assignee-pr:
49+
# ignore dependabot PRs
50+
if: ${{ github.event.pull_request && github.actor != 'dependabot[bot]' }}
51+
name: Assign PR to creator
52+
runs-on: ubuntu-latest
53+
permissions:
54+
issues: write
55+
pull-requests: write
56+
steps:
57+
- name: Set pull_request url and creator login
58+
# yamllint disable rule:line-length
59+
run: |
60+
echo "PR=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV
61+
echo "CREATOR=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV
62+
# yamllint enable rule:line-length
63+
- name: Assign PR to creator
64+
run: gh pr edit ${{ env.PR }} --add-assignee ${{ env.CREATOR }}
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
68+
auto-add-assignee-label:
69+
if: ${{ github.event.issue }}
70+
name: Assign issue to creator
71+
runs-on: ubuntu-latest
72+
permissions:
73+
issues: write
74+
pull-requests: write
75+
steps:
76+
- name: Checkout the repository
77+
uses: actions/checkout@v4
78+
- name: Set issue number and creator login
79+
run: |
80+
echo "ISSUE=${{ github.event.issue.number }}" >> $GITHUB_ENV
81+
echo "CREATOR=${{ github.event.issue.user.login }}" >> $GITHUB_ENV
82+
- name: Assign issue to creator
83+
run: gh issue edit ${{ env.ISSUE }} --add-assignee ${{ env.CREATOR }}
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# lint runs all linters in this repository
2+
# This workflow is triggered by ci_release.yml workflow
3+
name: lint
4+
on:
5+
workflow_call:
6+
7+
jobs:
8+
golangci-lint:
9+
name: golangci-lint
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-go@v5
14+
with:
15+
go-version-file: ./go.mod
16+
# This steps sets the GIT_DIFF environment variable to true
17+
# if files defined in PATTERS changed
18+
- uses: technote-space/[email protected]
19+
with:
20+
# This job will pass without running if go.mod, go.sum, and *.go
21+
# wasn't modified.
22+
PATTERNS: |
23+
**/**.go
24+
go.mod
25+
go.sum
26+
- uses: golangci/[email protected]
27+
with:
28+
version: latest
29+
args: --timeout 10m
30+
github-token: ${{ secrets.github_token }}
31+
if: env.GIT_DIFF
32+
33+
# hadolint lints the Dockerfile
34+
# hadolint:
35+
# uses: rollkit/.github/.github/workflows/[email protected] # yamllint disable-line rule:line-length
36+
# with:
37+
# dockerfile: Dockerfile
38+
# failure-threshold: error
39+
40+
yamllint:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
- uses: rollkit/.github/.github/actions/[email protected]
45+
46+
markdown-lint:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: rollkit/.github/.github/actions/[email protected]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Semantic Pull Request
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions:
11+
pull-requests: read
12+
13+
jobs:
14+
main:
15+
name: conventional-commit-pr-title
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: amannn/action-semantic-pull-request@v5
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Semantic Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Configure Semantic Release
15+
# Work around for non npm project
16+
# REF: https://github.com/cycjimmy/semantic-release-action/issues/115#issuecomment-1817264419
17+
run: echo '{"branches":[],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/github"]}' > .releaserc.json
18+
- name: Create Release
19+
uses: cycjimmy/semantic-release-action@v4
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
with:
23+
branches: |
24+
["main"]

.github/workflows/test.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Tests / Code Coverage workflow
2+
# This workflow is triggered by ci_release.yml workflow
3+
name: Tests / Code Coverage
4+
on:
5+
workflow_call:
6+
7+
jobs:
8+
go_mod_tidy_check:
9+
name: Go Mod Tidy Check
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-go@v5
14+
with:
15+
go-version-file: ./go.mod
16+
- run: go mod tidy
17+
- name: check for diff
18+
run: git diff --exit-code
19+
20+
unit_test:
21+
name: Run Unit Tests
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: set up go
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version-file: ./go.mod
29+
- name: Run unit test
30+
run: make test
31+
- name: upload coverage report
32+
uses: codecov/[email protected]
33+
with:
34+
token: ${{ secrets.CODECOV_TOKEN }}
35+
file: ./coverage.txt
36+
37+
integration_test:
38+
name: Run Integration Tests
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
- name: set up go
43+
uses: actions/setup-go@v5
44+
with:
45+
go-version-file: ./go.mod
46+
- name: Integration Tests
47+
run: echo "No integration tests yet"

.golangci.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
run:
2+
timeout: 5m
3+
modules-download-mode: readonly
4+
5+
linters:
6+
enable:
7+
- errorlint
8+
- errcheck
9+
- gofmt
10+
- goimports
11+
- gosec
12+
- gosimple
13+
- govet
14+
- ineffassign
15+
- misspell
16+
- revive
17+
- staticcheck
18+
- typecheck
19+
- unconvert
20+
- unused
21+
22+
issues:
23+
exclude-use-default: false
24+
# mempool and indexer code is borrowed from Tendermint
25+
exclude-dirs:
26+
- mempool
27+
- state/indexer
28+
- state/txindex
29+
- third_party
30+
include:
31+
- EXC0012 # EXC0012 revive: Annoying issue about not having a comment. The rare codebase has such comments
32+
- EXC0014 # EXC0014 revive: Annoying issue about not having a comment. The rare codebase has such comments
33+
34+
linters-settings:
35+
gosec:
36+
excludes:
37+
- G115
38+
revive:
39+
rules:
40+
- name: package-comments
41+
disabled: true
42+
- name: duplicated-imports
43+
severity: warning
44+
- name: exported
45+
arguments:
46+
- disableStutteringCheck
47+
48+
goimports:
49+
local-prefixes: github.com/rollkit

.markdownlint.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
default: true
2+
MD010:
3+
code_blocks: false
4+
MD013: false
5+
MD024:
6+
allow_different_nesting: true

0 commit comments

Comments
 (0)