Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: add ci workflows #8

Merged
merged 5 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# CODEOWNERS: <https://help.github.com/articles/about-codeowners/>

# Everything goes through the following "global owners" by default. Unless a later
# match takes precedence, the "global owners" will be requested for review when
# someone opens a PR. Note that the last matching pattern takes precedence, so
# global owners are only requested if there isn't a more specific codeowner
# specified below. For this reason, the global owners are often repeated in
# directory-level definitions.

# global owners
* @celestiaorg/celestia-core @celestiaorg/celestia-node
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Bug Report
description: Create a report to help us squash bugs!
title: "<title>"
labels: ["bug"]

body:
- type: markdown
attributes:
value: |
IMPORTANT: Prior to opening a bug report, check if it affects one of the
core modules and if it's eligible for a bug bounty on `SECURITY.md`.
Bugs that are not submitted through the appropriate channels won't
receive any bounty.

- type: textarea
id: summary
attributes:
label: Summary of Bug
description: Concisely describe the issue.
validations:
required: true

- type: textarea
id: version
attributes:
label: Version
description: git commit hash or release version
validations:
required: true

- type: textarea
id: repro
attributes:
label: Steps to Reproduce
description: >
What commands in order should someone run to reproduce your problem?
validations:
required: true

- type: checkboxes
id: admin
attributes:
label: For Admin Use
description: (do not edit)
options:
- label: Not duplicate issue
- label: Appropriate labels applied
- label: Appropriate contributors tagged
- label: Contributor assigned/self-assigned
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Feature Request
description: Create a proposal to request a feature
title: "<title>"
labels: ["enhancement"]

body:
- type: markdown
attributes:
value: |
✰ Thanks for opening an issue! ✰
Before smashing the submit button please fill in the template.
Word of caution: poorly thought-out proposals may be rejected without
deliberation.

- type: textarea
id: summary
attributes:
label: Summary
description: Short, concise description of the proposed feature.
validations:
required: true

- type: textarea
id: problem
attributes:
label: Problem Definition
description: |
Why do we need this feature?
What problems may be addressed by introducing this feature?
What benefits does the SDK stand to gain by including this feature?
Are there any disadvantages of including this feature?
validations:
required: true

- type: textarea
id: proposal
attributes:
label: Proposal
description: Detailed description of requirements of implementation.
validations:
required: true

- type: checkboxes
id: admin
attributes:
label: For Admin Use
description: (do not edit)
options:
- label: Not duplicate issue
- label: Appropriate labels applied
- label: Appropriate contributors tagged
- label: Contributor assigned/self-assigned
19 changes: 19 additions & 0 deletions .github/auto_request_review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# More info at https://github.com/necojackarc/auto-request-review
reviewers:
# The default reviewers
defaults:
# Example of Github Team. Github team must have write access to repo.
# NOTE: This assigned the team itself, not members of the team. The Github
# team auto PR assignment will then turn this into individuals
- team:celestia-core
- team:celestia-node

options:
ignore_draft: true
ignored_keywords:
- DO NOT REVIEW
enable_group_assignment: false

# Randomly pick reviewers up to this number.
# Do not set this option if you'd like to assign all matching reviewers.
number_of_reviewers: 2
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- dependencies
- package-ecosystem: gomod
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- dependencies
31 changes: 31 additions & 0 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: ci-release

# Run this workflow on push events (i.e. PR merge) to main or release branches,
# push events for new semantic version tags, and all PRs.
on:
push:
branches:
- main
- "v[0-9]+.x"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
pull_request:

jobs:
lint:
uses: ./.github/workflows/lint.yml

markdown-linter:
uses: ./.github/workflows/markdown-linter.yml

test:
uses: ./.github/workflows/test.yml

goreleaser:
uses: ./.github/workflows/goreleaser.yml
permissions: write-all
secrets:
GORELEASER_ACCESS_TOKEN: ${{ secrets.GORELEASER_ACCESS_TOKEN }}
cmwaters marked this conversation as resolved.
Show resolved Hide resolved
40 changes: 40 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: goreleaser
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this repo will only contain a Go library, I don't think we need this file because we don't need GoReleaser to create pre-built binaries.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is go releaser just for binaries? I thought it was triggered whenever releases were made

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GoReleaser can do other things but we only use it for creating binaries in celestia-app

on:
workflow_call:
secrets:
GORELEASER_ACCESS_TOKEN:
required: true

env:
GO_VERSION: '1.21.1'

jobs:
goreleaser-check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: check

goreleaser:
needs: goreleaser-check
runs-on: ubuntu-latest
if: |
(github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Create .release-env file
run: |-
echo 'GITHUB_TOKEN=${{secrets.GORELEASER_ACCESS_TOKEN}}' >> .release-env
- name: Create prebuilt binaries and attach them to the GitHub release
run: make prebuilt-binary
50 changes: 50 additions & 0 deletions .github/workflows/issue-label-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: issue-label-automation
on:
pull_request_target:
types: [opened]
issues:
types: [opened]
jobs:
automate-labels:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
env:
IS_BOT: ${{ (github.actor == 'dependabot[bot]' || github.actor == 'mergify[bot]') }}
IS_HUMAN: ${{ !(github.actor == 'dependabot[bot]' || github.actor == 'mergify[bot]') }}
steps:
- name: Check if issue or PR was created by external contributor
if: env.IS_HUMAN == 'true' && github.repository_owner == 'celestiaorg'
uses: tspascoal/get-user-teams-membership@v3
id: teamCheck
with:
username: ${{ github.actor }}
team: "celestia-core"
GITHUB_TOKEN: ${{ secrets.PAT_TEAM_CHECK }}
rootulp marked this conversation as resolved.
Show resolved Hide resolved

# If an issue was unlabeled add `needs:triage`.
- name: Maybe label issue with `needs:triage`
if: ${{ github.event_name == 'issues' }}
uses: andymckay/labeler@master
with:
add-labels: "needs:triage"
ignore-if-labeled: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
rootulp marked this conversation as resolved.
Show resolved Hide resolved

# If an issue or PR was created by someone that isn't part of
# celestia-core, add the `external` label.
- name: Maybe label issue or PR with `external`
if: env.IS_HUMAN == 'true' && steps.teamCheck.outputs.isTeamMember == 'false'
uses: andymckay/labeler@master
with:
add-labels: "external"
repo-token: ${{ secrets.GITHUB_TOKEN }}

# If a PR was created by dependabot or mergify add the `bot` label.
- name: Maybe label PR with `bot`
if: env.IS_BOT == 'true'
uses: andymckay/labeler@master
with:
add-labels: "bot"
repo-token: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/lint-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: lint-pull-request

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: conventional-commit-pr-title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
rootulp marked this conversation as resolved.
Show resolved Hide resolved
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: lint
on:
workflow_call:

env:
GO_VERSION: '1.21.1'

jobs:
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 8
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: technote-space/[email protected]
with:
# This job will pass without running if go.mod, go.sum, and *.go
# wasn't modified.
PATTERNS: |
**/**.go
go.mod
go.sum
- uses: golangci/[email protected]
with:
version: v1.55.2
args: --timeout 10m
github-token: ${{ secrets.github_token }}
rootulp marked this conversation as resolved.
Show resolved Hide resolved
if: env.GIT_DIFF

yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: celestiaorg/.github/.github/actions/[email protected]
23 changes: 23 additions & 0 deletions .github/workflows/markdown-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: markdown-linter
on:
workflow_call:

jobs:
markdown-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install markdownlint-cli
run: npm install -g [email protected]
shell: bash

- name: Run markdownlint
run: markdownlint --config .markdownlint.yaml **/*.md
shell: bash
23 changes: 23 additions & 0 deletions .github/workflows/pr-review-requester.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: pr-review-requester

on:
# pull_request_target is used to allow forks write permissions when running
# this workflow. With the pull_request trigger, forks do not have any write
# access for security reasons, however write access is needed in order to
# request reviews. Since this workflow is simply requesting reviewers, it is
# safe to allow forks write access.
pull_request_target:

jobs:
auto-request-review:
name: Auto request reviews
uses: celestiaorg/.github/.github/workflows/[email protected] # yamllint disable-line rule:line-length
secrets: inherit
# write access for issues and pull requests is needed because the called
# workflow requires write access to issues and pull requests and the
# permissions must match
permissions:
issues: write
pull-requests: write
with:
run-auto-request-review: true
14 changes: 14 additions & 0 deletions .github/workflows/project-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: project-automation
on:
issues:
types:
- opened
jobs:
add-to-project:
name: Add new issues to the core/app project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@main
with:
project-url: https://github.com/orgs/celestiaorg/projects/24
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
rootulp marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading