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

feat!: Nymlab (AVIDA Protocol) Prop31 Stage 1 implementation(#628) #682

Merged
merged 7 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 10 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,27 @@

version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
target-branch: "develop"
directory: "/"
schedule:
interval: "weekly"
interval: "weekly"
ignore:
- dependency-name: "*"
update-types:
- version-update:semver-patch

# Maintain dependencies for NPM
- package-ecosystem: "npm"
target-branch: "develop"
directory: "/"
schedule:
interval: "weekly"
interval: "weekly"
ignore:
- dependency-name: "*"
update-types:
- version-update:semver-patch

# Maintain dependencies for Docker
- package-ecosystem: "docker"
Expand Down
28 changes: 24 additions & 4 deletions .github/linters/.golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ linters:
- goconst
- gocritic
- gofumpt
- gofmt
- goimports
- gosimple
- govet
Expand All @@ -25,7 +26,12 @@ linters:
- typecheck
- unconvert
- unused


issues:
exclude-rules:
- text: "ST1003:"
linters:
- stylecheck

linters-settings:
dogsled:
Expand All @@ -42,8 +48,8 @@ linters-settings:
- badCall # Remove this after CI workflow PR

gofumpt:
lang-version: "1.18"
lang-version: "1.21"

misspell:
ignore-words:
- cheqd
Expand All @@ -52,7 +58,7 @@ linters-settings:

stylecheck:
# Select the Go version to target.
go: "1.18"
go: "1.21"
# STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
# Default: ["*"]
checks: ["all"]
Expand All @@ -62,3 +68,17 @@ linters-settings:
- "github.com/onsi/gomega"
# https://staticcheck.io/docs/configuration/options/#initialisms
initialisms: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"]

depguard:
rules:
main:
files:
- $all
list-mode: lax
allow: "*"

goconst:
min-occurrences: 5
ignore-tests: true
ignore-strings: "echo '"

16 changes: 13 additions & 3 deletions .github/linters/mlc_config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"aliveStatusCodes": [0, 200, 206, 403, 501, 999],
"aliveStatusCodes": [
0,
200,
206,
403,
501,
999
],
"replacementPatterns": [
{
"pattern": "\" %}",
Expand All @@ -12,8 +19,11 @@
],
"ignorePatterns": [
{
"pattern": "^https://resolver.cheqd.net/"
"pattern": "^https://resolver.cheqd.net/"
},
{
"pattern": "^https://twitter.com/"
}
],
"retryOn429": true
}
}
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
defaults:
run:
shell: bash
permissions:
contents: write
packages: read
checks: write


jobs:
Expand All @@ -15,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
cache: true
Expand All @@ -28,7 +32,7 @@ jobs:
args: build --clean --snapshot --single-target

- name: Store artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cheqd-noded
path: dist/linux-amd64_linux_amd64_v1/cheqd-noded
Expand Down Expand Up @@ -75,7 +79,7 @@ jobs:
cache-to: type=gha,mode=min

- name: Upload Docker build image
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cheqd-node-build.tar
path: /tmp/cheqd-node-build.tar
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
languages: 'go'
queries: security-and-quality

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: 1.18

Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ jobs:
sh-euox-pipefail-check:
name: "Shell pipefail check"
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4

- name: Run 'set -euox pipefail' check
run: bash ./.github/scripts/ensure_set_euox_pipefail.sh

md-link-check:
name: "Broken Markdown links"
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4

Expand All @@ -30,43 +29,43 @@ jobs:
with:
config-file: '.github/linters/mlc_config.json'
use-quiet-mode: 'yes'

go-lint:
# We can't use VALIDATE_GO from super linter because of this issue:
# https://github.com/github/super-linter/issues/143
name: "Golang"
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
cache: true
cache: false # temporarily off, as golangci-lint doesn't align 100% with cached setup-go@v4, see: https://github.com/golangci/golangci-lint-action/issues/807

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.49.0
version: v1.56.2
args: --config .github/linters/.golangci.yaml

proto-lint:
name: "Protobuf"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

# Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1.27.0
- uses: bufbuild/buf-setup-action@v1.28.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

# Lint
- uses: bufbuild/buf-lint-action@v1
with:
input: proto

# Breaking change detection
- uses: bufbuild/buf-breaking-action@v1
continue-on-error: true
Expand All @@ -77,7 +76,7 @@ jobs:
super-lint:
name: "Super Linter"
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: amannn/action-semantic-pull-request@v5.3.0
- uses: amannn/action-semantic-pull-request@v5.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ on:
defaults:
run:
shell: bash
permissions:
contents: write
packages: write


jobs:
# Super Linter only runs on diffs in PRs
Expand All @@ -17,7 +13,7 @@ jobs:
super-lint:
name: "Super Linter"
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -48,23 +44,23 @@ jobs:
outputs:
RELEASE_VERSION: ${{ steps.set-version.outputs.RELEASE_VERSION }}
EXECUTE_RELEASE: ${{ steps.execute-release.outputs.EXECUTE_RELEASE }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to fetch version
persist-credentials: false

# Node.js setup is needed to run Semantic Release
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: 'npm'

# Required for short-lived token provided to Semantic Release
- name: "Obtain Github App token"
id: app-token
uses: getsentry/action-github-app-token@v2.0.0
uses: getsentry/action-github-app-token@v3.0.0
with:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_APP_PRIVATE_KEY }}
Expand All @@ -81,7 +77,7 @@ jobs:
- name: Check whether to execute release
id: execute-release
run: |
tag=$(git describe --tags --exact-match)
tag=$(git describe --tags --exact-match) || exit 0
if [[ $tag =~ ^v ]]; then
echo "EXECUTE_RELEASE=true" >> "$GITHUB_OUTPUT"
else
Expand All @@ -103,20 +99,20 @@ jobs:
needs: [ super-lint, release-guard ]
# Only run if release-guard outputs EXECUTE_RELEASE=true
if: needs.release-guard.outputs.EXECUTE_RELEASE == 'true'

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to fetch version
persist-credentials: false

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
cache: true

# Setup for pushing to Buf.build later
- uses: bufbuild/buf-setup-action@v1.27.0
- uses: bufbuild/buf-setup-action@v1.28.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -162,7 +158,7 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Configure Docker image metadata
id: meta
uses: docker/metadata-action@v5
Expand Down
Loading
Loading