Skip to content

Commit

Permalink
change Seth lint to use action
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Aug 27, 2024
1 parent 73083b4 commit e80be96
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 13 deletions.
55 changes: 45 additions & 10 deletions .github/workflows/seth-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,62 @@ on:
permissions:
contents: read
jobs:
golangci:
tools:
defaults:
run:
working-directory: seth
name: lint
name: Get tool-versions
runs-on: ubuntu-latest
outputs:
golangci-lint-version: ${{ steps.tool-versions.outputs.golangci-lint_version }}
should_run: ${{ steps.changes.outputs.src }}
steps:
- name: Checkout repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Check for changes in Seth project
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
src:
- 'seth/**'
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
- name: Check out Code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
if: steps.changes.outputs.src == 'true'
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run lints
- name: Parse tool-versions file
if: steps.changes.outputs.src == 'true'
run: |
nix develop -c make lint
uses: smartcontractkit/tool-versions-to-env-action@aabd5efbaf28005284e846c5cf3a02f2cba2f4c2 # v1.0.8
id: tool-versions

golangci:
defaults:
run:
working-directory: seth
name: Linting Seth
if: needs.tools.outputs.should_run == 'true'
runs-on: ubuntu-latest
needs: [tools]
steps:
- name: Check out Code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Install Go
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-go@e29366cdecfe6befff9ab8c3cfe4825218505d58 # v2.3.16
with:
test_download_vendor_packages_command: cd seth && go mod download
go_mod_path: seth/go.mod
cache_key_id: ctf-go-seth
cache_restore_only: 'false'
- name: golangci-lint ${{ needs.tools.outputs.golangci-lint-version }}
uses: golangci/golangci-lint-action@9d1e0624a798bb64f6c3cea93db47765312263dc # v5.1.0
with:
version: v${{ needs.tools.outputs.golangci-lint-version }}
args: --out-format checkstyle:golangci-lint-report.xml
skip-cache: true
working-directory: seth
- name: Print lint report artifact
if: always()
run: test -f seth/}golangci-lint-report.xml || true

Check failure on line 59 in .github/workflows/seth-lint.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/seth-lint.yml#L59

shellcheck reported issue in this script: SC1083:warning:1:14: This } is literal. Check expression (missing ;/\n?) or quote it [shellcheck]
Raw output
.github/workflows/seth-lint.yml:59:9: shellcheck reported issue in this script: SC1083:warning:1:14: This } is literal. Check expression (missing ;/\n?) or quote it [shellcheck]
- name: Store lint report artifact
if: always()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: golangci-lint-report-seth
path: seth/golangci-lint-report.xml
2 changes: 1 addition & 1 deletion seth/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ linters-settings:
exhaustive:
default-signifies-exhaustive: true
goimports:
local-prefixes: github.com/smartcontractkit/chainlink-testing-framework
local-prefixes: github.com/smartcontractkit/chainlink-testing-framework/seth
gosec:
exclude-generated: true
govet:
Expand Down
2 changes: 0 additions & 2 deletions seth/contract_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ func extractABIFromGethWrapperDir(filePath string) (string, *abi.ABI, error) {
return "", nil, err
}

const metaDataSuffix = "MetaData"

var abiContent string
// use package name as contract name
contractName := node.Name.Name
Expand Down

0 comments on commit e80be96

Please sign in to comment.