Skip to content

Commit

Permalink
Merge branch 'ap/fix-tests' into ci-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurdotb committed Feb 27, 2024
2 parents fdeaed7 + 1d0e9bd commit 8c9c0bd
Show file tree
Hide file tree
Showing 314 changed files with 4,327 additions and 20,903 deletions.
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 '"

15 changes: 11 additions & 4 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 @@ -15,8 +22,8 @@
"pattern": "^https://resolver.cheqd.net/"
},
{
"pattern": "^https://twitter.com/"
}
"pattern": "^https://twitter.com/"
}
],
"retryOn429": true
}
}
4 changes: 4 additions & 0 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 Down
23 changes: 11 additions & 12 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@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/[email protected]
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
14 changes: 5 additions & 9 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,7 +44,7 @@ jobs:
outputs:
RELEASE_VERSION: ${{ steps.set-version.outputs.RELEASE_VERSION }}
EXECUTE_RELEASE: ${{ steps.execute-release.outputs.EXECUTE_RELEASE }}

steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -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,7 +99,7 @@ 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:
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

0 comments on commit 8c9c0bd

Please sign in to comment.