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

ci: add new CI jobs and bring existing ones into compliance #1233

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[codespell]
skip = *.pulsar.go,*.pb.go,*.pb.gw.go,*.json,*.git,*.bin,*.sum,*.mod,query_test.go
skip = *.pulsar.go,*.pb.go,*.pb.gw.go,*.json,*.git,*.bin,*.sum,*.mod,query_test.go,*.sol
ignore-words-list = usera,pres,crate
count =
quiet-level = 3
35 changes: 0 additions & 35 deletions .github/workflows/chores.yml

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '59 23 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages.
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ✏️ If the Autobuild fails above, remove it and uncomment the following lines
# and modify them (or add more) to build your code.

#- run: |
# make install

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
71 changes: 42 additions & 29 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
name: golangci-lint
# Lint the entire golang project. This workflow relies on the
# '.golangci.yml' file for its configuration settings.
name: Lint
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:

permissions:
contents: read

env:
GO_VERSION: 1.22

jobs:
clippy-lint:
defaults:
run:
working-directory: local-interchain/rust/localic-std
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable with clippy and rustfmt
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- name: Install clippy
run: rustup component add clippy
- name: Update
run: cargo update
- name: Run clippy
run: make lint

golangci:
name: lint
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
go-version: ${{ env.GO_VERSION }}

- uses: actions/checkout@v4

- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6.1.0
with:
version: v1.54
only-new-issues: true
args: --timeout=10m

clippy-lint:
defaults:
run:
working-directory: local-interchain/rust/localic-std
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable with clippy and rustfmt
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- name: Install clippy
run: rustup component add clippy
- name: Update
run: cargo update
- name: Run clippy
run: make lint

jtieri marked this conversation as resolved.
Show resolved Hide resolved
version: v1.57.2
args: --timeout 15m
11 changes: 11 additions & 0 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Markdown Link Check

on:
pull_request:

jobs:
link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@1.0.15
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [created]

env:
GO_VERSION: 1.21
GO_VERSION: 1.21

jobs:
release-static-binary:
Expand All @@ -18,7 +18,7 @@ jobs:
- name: Setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version: ${{ env.GO_VERSION }}

# NOTE: make install must not be statically linked to the MakeFileInstallDirectory
- run: cd local-interchain && go mod tidy && IGNORE_STATIC_LINK=true make install
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Spell Check

on:
pull_request:

jobs:
spellcheck:
name: Run codespell
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install codespell
run: pip install codespell

- name: Run codespell
run: codespell
20 changes: 20 additions & 0 deletions .github/workflows/title-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Lint PR Title"

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

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69 changes: 69 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
run:
timeout: 10m
tests: true

# These linter checks can be modified on a per project basis.
# Simply remove them from the enable list to disable them.
linters:
disable-all: true
enable:
- asciicheck
- bidichk
- bodyclose
- decorder
- dupl
- dupword
- errcheck
- errchkjson
- errname
- exhaustive
- exportloopref
- forbidigo
- gci
- goconst
- gocritic
- godot
- gofumpt
- gosec
- gosimple
- gosmopolitan
- govet
- grouper
- ineffassign
- loggercheck
- misspell
- nilerr
- nilnil
- noctx
- staticcheck
- stylecheck
- testifylint
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace

linters-settings:
gci:
custom-order: true
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- blank # blank imports
- dot # dot imports
- prefix(cosmossdk.io)
- prefix(github.com/cosmos)
- prefix(github.com/cosmos/cosmos-sdk)
- prefix(github.com/cometbft/cometbft)
- prefix(github.com/strangelove-ventures/interchaintest)
gosec:
excludes:
- G404 # disables checks on insecure random number source

issues:
max-issues-per-linter: 0
2 changes: 1 addition & 1 deletion blockdb/collect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestCollector_Collect(t *testing.T) {
savedHeights = append(savedHeights, int(height))
savedTxs = append(savedTxs, txs)
}
atomic.SwapInt64(&currentHeight, int64(height))
atomic.SwapInt64(&currentHeight, height)
return nil
})

Expand Down
6 changes: 4 additions & 2 deletions blockdb/messages_view_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ import (
"path/filepath"
"testing"

"cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/types"
"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/relayer"
"github.com/strangelove-ventures/interchaintest/v8/testreporter"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

"cosmossdk.io/math"

"github.com/cosmos/cosmos-sdk/types"
)

func TestMessagesView(t *testing.T) {
Expand Down
9 changes: 4 additions & 5 deletions blockdb/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ package blockdb

import (
"context"
_ "embed"
"encoding/json"
"strings"
"testing"
"time"

"github.com/stretchr/testify/require"
)

var (
//go:embed testdata/sample_txs.json
txsFixture []byte
_ "embed"
)

//go:embed testdata/sample_txs.json
var txsFixture []byte

func TestQuery_CurrentSchemaVersion(t *testing.T) {
t.Parallel()

Expand Down
Loading
Loading