Skip to content

Commit

Permalink
add ci workflows (from celestia-app)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmwaters committed Jan 4, 2024
1 parent 1c0eefa commit e9493dd
Show file tree
Hide file tree
Showing 14 changed files with 417 additions and 0 deletions.
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
* @evan-forbes @rootulp @cmwaters @Wondertan @renaynay
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

Check failure on line 8 in .github/auto_request_review.yml

View workflow job for this annotation

GitHub Actions / lint / yamllint

8:25 [trailing-spaces] trailing spaces
- 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 }}
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
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

Check failure on line 38 in .github/workflows/goreleaser.yml

View workflow job for this annotation

GitHub Actions / lint / yamllint

38:81 [line-length] line too long (82 > 80 characters)
- 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]') }}

Check failure on line 14 in .github/workflows/issue-label-automation.yml

View workflow job for this annotation

GitHub Actions / lint / yamllint

14:81 [line-length] line too long (90 > 80 characters)
IS_HUMAN: ${{ !(github.actor == 'dependabot[bot]' || github.actor == 'mergify[bot]') }}

Check failure on line 15 in .github/workflows/issue-label-automation.yml

View workflow job for this annotation

GitHub Actions / lint / yamllint

15:81 [line-length] line too long (93 > 80 characters)
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 }}

# 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 }}

# 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'

Check failure on line 38 in .github/workflows/issue-label-automation.yml

View workflow job for this annotation

GitHub Actions / lint / yamllint

38:81 [line-length] line too long (85 > 80 characters)
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 }}
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 }}
if: env.GIT_DIFF

yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: celestiaorg/.github/.github/actions/[email protected]
35 changes: 35 additions & 0 deletions .github/workflows/markdown-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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

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

- name: Run markdown link check
uses: gaurav-nelson/[email protected]
with:
config-file: '.github/markdown-link-check-config.json'
folder-path: '.'
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
Loading

0 comments on commit e9493dd

Please sign in to comment.