Skip to content

Commit 79d147e

Browse files
authored
chore!: add ci workflows (celestiaorg#8)
1 parent 0b49c5a commit 79d147e

18 files changed

+392
-2
lines changed

.github/CODEOWNERS

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# CODEOWNERS: <https://help.github.com/articles/about-codeowners/>
2+
3+
# Everything goes through the following "global owners" by default. Unless a later
4+
# match takes precedence, the "global owners" will be requested for review when
5+
# someone opens a PR. Note that the last matching pattern takes precedence, so
6+
# global owners are only requested if there isn't a more specific codeowner
7+
# specified below. For this reason, the global owners are often repeated in
8+
# directory-level definitions.
9+
10+
# global owners
11+
* @celestiaorg/celestia-core @celestiaorg/celestia-node

.github/ISSUE_TEMPLATE/bug-report.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Bug Report
2+
description: Create a report to help us squash bugs!
3+
title: "<title>"
4+
labels: ["bug"]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
IMPORTANT: Prior to opening a bug report, check if it affects one of the
11+
core modules and if it's eligible for a bug bounty on `SECURITY.md`.
12+
Bugs that are not submitted through the appropriate channels won't
13+
receive any bounty.
14+
15+
- type: textarea
16+
id: summary
17+
attributes:
18+
label: Summary of Bug
19+
description: Concisely describe the issue.
20+
validations:
21+
required: true
22+
23+
- type: textarea
24+
id: version
25+
attributes:
26+
label: Version
27+
description: git commit hash or release version
28+
validations:
29+
required: true
30+
31+
- type: textarea
32+
id: repro
33+
attributes:
34+
label: Steps to Reproduce
35+
description: >
36+
What commands in order should someone run to reproduce your problem?
37+
validations:
38+
required: true
39+
40+
- type: checkboxes
41+
id: admin
42+
attributes:
43+
label: For Admin Use
44+
description: (do not edit)
45+
options:
46+
- label: Not duplicate issue
47+
- label: Appropriate labels applied
48+
- label: Appropriate contributors tagged
49+
- label: Contributor assigned/self-assigned
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Feature Request
2+
description: Create a proposal to request a feature
3+
title: "<title>"
4+
labels: ["enhancement"]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
✰ Thanks for opening an issue! ✰
11+
Before smashing the submit button please fill in the template.
12+
Word of caution: poorly thought-out proposals may be rejected without
13+
deliberation.
14+
15+
- type: textarea
16+
id: summary
17+
attributes:
18+
label: Summary
19+
description: Short, concise description of the proposed feature.
20+
validations:
21+
required: true
22+
23+
- type: textarea
24+
id: problem
25+
attributes:
26+
label: Problem Definition
27+
description: |
28+
Why do we need this feature?
29+
What problems may be addressed by introducing this feature?
30+
What benefits does the SDK stand to gain by including this feature?
31+
Are there any disadvantages of including this feature?
32+
validations:
33+
required: true
34+
35+
- type: textarea
36+
id: proposal
37+
attributes:
38+
label: Proposal
39+
description: Detailed description of requirements of implementation.
40+
validations:
41+
required: true
42+
43+
- type: checkboxes
44+
id: admin
45+
attributes:
46+
label: For Admin Use
47+
description: (do not edit)
48+
options:
49+
- label: Not duplicate issue
50+
- label: Appropriate labels applied
51+
- label: Appropriate contributors tagged
52+
- label: Contributor assigned/self-assigned

.github/auto_request_review.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# More info at https://github.com/necojackarc/auto-request-review
2+
reviewers:
3+
# The default reviewers
4+
defaults:
5+
# Example of Github Team. Github team must have write access to repo.
6+
# NOTE: This assigned the team itself, not members of the team. The Github
7+
# team auto PR assignment will then turn this into individuals
8+
- team:celestia-core
9+
- team:celestia-node
10+
11+
options:
12+
ignore_draft: true
13+
ignored_keywords:
14+
- DO NOT REVIEW
15+
enable_group_assignment: false
16+
17+
# Randomly pick reviewers up to this number.
18+
# Do not set this option if you'd like to assign all matching reviewers.
19+
number_of_reviewers: 2

.github/dependabot.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
labels:
9+
- dependencies
10+
- package-ecosystem: gomod
11+
directory: "/"
12+
schedule:
13+
interval: weekly
14+
open-pull-requests-limit: 10
15+
labels:
16+
- dependencies

.github/workflows/ci-release.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: ci-release
2+
3+
# Run this workflow on push events (i.e. PR merge) to main or release branches,
4+
# push events for new semantic version tags, and all PRs.
5+
on:
6+
push:
7+
branches:
8+
- main
9+
- "v[0-9]+.x"
10+
tags:
11+
- "v[0-9]+.[0-9]+.[0-9]+"
12+
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
13+
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
14+
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
15+
pull_request:
16+
17+
jobs:
18+
lint:
19+
uses: ./.github/workflows/lint.yml
20+
21+
markdown-linter:
22+
uses: ./.github/workflows/markdown-linter.yml
23+
24+
test:
25+
uses: ./.github/workflows/test.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: issue-label-automation
2+
on:
3+
pull_request_target:
4+
types: [opened]
5+
issues:
6+
types: [opened]
7+
jobs:
8+
automate-labels:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
pull-requests: write
13+
env:
14+
IS_BOT: ${{ (github.actor == 'dependabot[bot]' || github.actor == 'mergify[bot]') }}
15+
IS_HUMAN: ${{ !(github.actor == 'dependabot[bot]' || github.actor == 'mergify[bot]') }}
16+
steps:
17+
- name: Check if issue or PR was created by external contributor
18+
if: env.IS_HUMAN == 'true' && github.repository_owner == 'celestiaorg'
19+
uses: tspascoal/get-user-teams-membership@v3
20+
id: teamCheck
21+
with:
22+
username: ${{ github.actor }}
23+
team: "celestia-core"
24+
GITHUB_TOKEN: ${{ secrets.PAT_TEAM_CHECK }}
25+
26+
# If an issue was unlabeled add `needs:triage`.
27+
- name: Maybe label issue with `needs:triage`
28+
if: ${{ github.event_name == 'issues' }}
29+
uses: andymckay/labeler@master
30+
with:
31+
add-labels: "needs:triage"
32+
ignore-if-labeled: true
33+
repo-token: ${{ secrets.GITHUB_TOKEN }}
34+
35+
# If an issue or PR was created by someone that isn't part of
36+
# celestia-core, add the `external` label.
37+
- name: Maybe label issue or PR with `external`
38+
if: env.IS_HUMAN == 'true' && steps.teamCheck.outputs.isTeamMember == 'false'
39+
uses: andymckay/labeler@master
40+
with:
41+
add-labels: "external"
42+
repo-token: ${{ secrets.GITHUB_TOKEN }}
43+
44+
# If a PR was created by dependabot or mergify add the `bot` label.
45+
- name: Maybe label PR with `bot`
46+
if: env.IS_BOT == 'true'
47+
uses: andymckay/labeler@master
48+
with:
49+
add-labels: "bot"
50+
repo-token: ${{ secrets.GITHUB_TOKEN }}
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: lint-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 }}

.github/workflows/lint.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: lint
2+
on:
3+
workflow_call:
4+
5+
env:
6+
GO_VERSION: '1.21.1'
7+
8+
jobs:
9+
golangci-lint:
10+
name: golangci-lint
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 8
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-go@v5
16+
with:
17+
go-version: ${{ env.GO_VERSION }}
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: v1.55.2
29+
args: --timeout 10m
30+
github-token: ${{ secrets.github_token }}
31+
if: env.GIT_DIFF
32+
33+
yamllint:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: celestiaorg/.github/.github/actions/[email protected]

.github/workflows/markdown-linter.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: markdown-linter
2+
on:
3+
workflow_call:
4+
5+
jobs:
6+
markdown-lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v4
11+
12+
- name: Setup Node
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: 18
16+
17+
- name: Install markdownlint-cli
18+
run: npm install -g [email protected]
19+
shell: bash
20+
21+
- name: Run markdownlint
22+
run: markdownlint --config .markdownlint.yaml **/*.md
23+
shell: bash
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: pr-review-requester
2+
3+
on:
4+
# pull_request_target is used to allow forks write permissions when running
5+
# this workflow. With the pull_request trigger, forks do not have any write
6+
# access for security reasons, however write access is needed in order to
7+
# request reviews. Since this workflow is simply requesting reviewers, it is
8+
# safe to allow forks write access.
9+
pull_request_target:
10+
11+
jobs:
12+
auto-request-review:
13+
name: Auto request reviews
14+
uses: celestiaorg/.github/.github/workflows/[email protected] # yamllint disable-line rule:line-length
15+
secrets: inherit
16+
# write access for issues and pull requests is needed because the called
17+
# workflow requires write access to issues and pull requests and the
18+
# permissions must match
19+
permissions:
20+
issues: write
21+
pull-requests: write
22+
with:
23+
run-auto-request-review: true
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: project-automation
2+
on:
3+
issues:
4+
types:
5+
- opened
6+
jobs:
7+
add-to-project:
8+
name: Add new issues to the core/app project
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/add-to-project@main
12+
with:
13+
project-url: https://github.com/orgs/celestiaorg/projects/24
14+
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}

.github/workflows/test.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: test
2+
on:
3+
workflow_call:
4+
5+
env:
6+
GO_VERSION: '1.21.1'
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- uses: actions/setup-go@v5
15+
with:
16+
go-version: ${{ env.GO_VERSION }}
17+
18+
- name: Run tests
19+
run: go test ./... -v -timeout 5m -race

.golangci.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
run:
2+
timeout: 5m
3+
modules-download-mode: readonly
4+
5+
linters:
6+
enable:
7+
- exportloopref
8+
- gofumpt
9+
- misspell
10+
- nakedret
11+
- revive
12+
- prealloc
13+
- stylecheck
14+
15+
linters-settings:
16+
nakedret:
17+
# Ban the use of naked returns because they reduce code readability.
18+
max-func-lines: 0 # override the default: 30

.markdownlint.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"default": true # Default state for all rules
2+
"MD010":
3+
"code_blocks": false # Disable rule for hard tabs in code blocks
4+
"MD013": false # Disable rule for line length
5+
"MD033": false # Disable rule banning inline HTML

0 commit comments

Comments
 (0)