-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* check for dependencies weekly no need to check daily * cancel previous runs upon new push * only run cometbft-db-testing when a new tag is created * add mergify, PR and issue templates * add conventional-pr-title and markdown-linter workflows * add fast ci option * add markdownlint config files * correct config * fix codeql formatting
- Loading branch information
Showing
15 changed files
with
285 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
labels: needs-triage | ||
--- | ||
|
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,14 @@ | ||
<!-- | ||
Please add a reference to the issue that this PR addresses and indicate which | ||
files are most critical to review. If it fully addresses a particular issue, | ||
please include "Closes #XXX" (where "XXX" is the issue number). | ||
--> | ||
|
||
--- | ||
|
||
#### PR checklist | ||
|
||
- [ ] Tests written/updated | ||
- [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) |
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,15 @@ | ||
# markdownlint configuration for Super-Linter | ||
# - https://github.com/DavidAnson/markdownlint | ||
# - https://github.com/github/super-linter | ||
|
||
# Default state for all rules | ||
default: true | ||
|
||
# See https://github.com/DavidAnson/markdownlint#rules--aliases for rules | ||
MD007: {"indent": 4} | ||
MD013: false | ||
MD024: {siblings_only: true} | ||
MD025: false | ||
MD033: {no-inline-html: false} | ||
no-hard-tabs: false | ||
whitespace: false |
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,9 @@ | ||
--- | ||
# Default rules for YAML linting from super-linter. | ||
# See: See https://yamllint.readthedocs.io/en/stable/rules.html | ||
extends: default | ||
rules: | ||
document-end: disable | ||
document-start: disable | ||
line-length: disable | ||
truthy: disable |
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,25 @@ | ||
pull_request_rules: | ||
- name: automatic approval for Dependabot pull requests | ||
conditions: | ||
- author=dependabot[bot] | ||
actions: | ||
review: | ||
type: APPROVE | ||
message: Automatically approving dependabot | ||
|
||
- name: automatically merge PR with automerge label | ||
conditions: | ||
- '-label=manual-backport' | ||
- label=automerge | ||
actions: | ||
merge: | ||
method: squash | ||
|
||
- name: Make sure PR are up to date before merging | ||
description: >- | ||
This automatically updates PRs when they are out-of-date with the base | ||
branch to avoid semantic conflicts (next step is using a merge queue). | ||
conditions: | ||
- '-draft' | ||
actions: | ||
update: |
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,37 @@ | ||
name: Test fast (no changes to Dockerfile) | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- "tools/**" | ||
merge_group: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- "tools/**" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
||
jobs: | ||
test-fast: | ||
runs-on: ubuntu-latest | ||
container: cometbft/cometbft-db-testing | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- run: echo "GO_VERSION=$(cat .github/workflows/go-version.env | grep GO_VERSION | cut -d '=' -f2)" >> $GITHUB_ENV | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: test & coverage report creation | ||
run: | | ||
NON_INTERACTIVE=1 make test-all-with-coverage | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
file: ./coverage.txt |
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
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,65 @@ | ||
name: "Conventional PR Title" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
main: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
id: lint_pr_title | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
types: | | ||
feat | ||
fix | ||
build | ||
chore | ||
ci | ||
docs | ||
refactor | ||
perf | ||
test | ||
revert | ||
spec | ||
merge | ||
- uses: marocchino/sticky-pull-request-comment@v2 | ||
# When the previous steps fails, the workflow would stop. By adding this | ||
# condition you can continue the execution with the populated error message. | ||
if: always() && (steps.lint_pr_title.outputs.error_message != null) | ||
with: | ||
header: pr-title-lint-error | ||
message: | | ||
Hey there and thank you for opening this pull request! 👋🏼 | ||
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted. | ||
Details: | ||
``` | ||
${{ steps.lint_pr_title.outputs.error_message }} | ||
``` | ||
General format: `type(scope): msg` | ||
Breaking change: `type(scope)!: msg` | ||
Multi-scope change: `type: msg` | ||
Types: `feat`, `fix`, `build`, `chore`, `ci`, `docs`, `refactor`, `perf`, `test`, `revert`, `spec`, `merge`. | ||
Example: `fix(cmd/cometbft/commands/debug): execute p.Signal only when p is not nil` | ||
# Delete a previous comment when the issue has been resolved | ||
- if: ${{ steps.lint_pr_title.outputs.error_message == null }} | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: pr-title-lint-error | ||
delete: true |
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 |
---|---|---|
|
@@ -11,10 +11,8 @@ | |
|
||
name: Docker testing image | ||
on: | ||
workflow_dispatch: | ||
workflow_dispatch: # allow running workflow manually | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" # e.g. v0.37.0-alpha.1, v0.38.0-alpha.10 | ||
|
@@ -26,24 +24,6 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
DOCKER_IMAGE=cometbft/cometbft-db-testing | ||
VERSION=noop | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
VERSION=${GITHUB_REF#refs/tags/} | ||
elif [[ $GITHUB_REF == refs/heads/* ]]; then | ||
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') | ||
if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then | ||
VERSION=latest | ||
fi | ||
fi | ||
TAGS="${DOCKER_IMAGE}:${VERSION}" | ||
if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then | ||
TAGS="$TAGS,${DOCKER_IMAGE}:${VERSION}" | ||
fi | ||
echo "tags=${TAGS}" >> $GITHUB_OUTPUT | ||
|
||
- name: Set up Docker Build | ||
uses: docker/[email protected] | ||
|
@@ -60,5 +40,7 @@ jobs: | |
context: ./tools | ||
file: ./tools/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.prep.outputs.tags }} | ||
push: true | ||
tags: | | ||
cometbft/cometbft-db-testing:latest | ||
cometbft/cometbft-db-testing:${{ github.ref_name }} |
Oops, something went wrong.