Skip to content

update workflows and tool-versions #418

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

Merged
merged 2 commits into from
Aug 29, 2022
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,46 @@
name: Linting
on:
push:
pull_request:
jobs:
tools:
name: Get tool-versions
runs-on: ubuntu-latest
steps:
- name: Check out Code
uses: actions/checkout@v3
- name: Parse tool-versions file
uses: smartcontractkit/[email protected]
id: tool-versions
outputs:
go-version: ${{ steps.tool-versions.outputs.golang_version }}
golangci-lint-version: ${{ steps.tool-versions.outputs.golangci-lint_version }}
golangci:
name: Linting
runs-on: ubuntu-latest
needs: [tools]
steps:
- name: Check out Code
uses: actions/checkout@v3
- uses: smartcontractkit/[email protected]
id: go-version
- run: echo ${{ steps.go-version.outputs.golang_version }}
- name: Install Go ${{ steps.go-version.outputs.golang_version }}
- name: Install Go ${{ needs.tools.outputs.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.golang_version }}
- name: golangci-lint
go-version: ${{ needs.tools.outputs.go-version }}
- name: golangci-lint ${{ needs.tools.outputs.golangci-lint-version }}
uses: golangci/[email protected]
with:
version: v1.47.3
version: v${{ needs.tools.outputs.golangci-lint-version }}

vulnerabilities-check:
name: Check for Vulnerabilities
runs-on: ubuntu-latest
needs: [tools]
steps:
- name: Check out Code
uses: actions/checkout@v3
- uses: smartcontractkit/[email protected]
id: go-version
- run: echo ${{ steps.go-version.outputs.golang_version }}
- name: Install Go ${{ steps.go-version.outputs.golang_version }}
- name: Install Go ${{ needs.tools.outputs.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.golang_version }}
go-version: ${{ needs.tools.outputs.go-version }}
- name: Write Go List
run: go list -json -deps ./... > go.list
- name: Nancy
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
tags:
- v*
branches:
- master
- main
pull_request:
jobs:
Expand All @@ -15,7 +14,6 @@ jobs:
uses: actions/checkout@v3
- uses: smartcontractkit/[email protected]
id: go-version
- run: echo ${{ steps.go-version.outputs.golang_version }}
- name: Install Go ${{ steps.go-version.outputs.golang_version }}
uses: actions/setup-go@v3
with:
Expand Down
13 changes: 9 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,20 @@ run:
linters:
enable:
# defaults
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
# extra
- exhaustive
- exportloopref
- revive
- goimports
- gosec
- misspell
- rowserrcheck
- errorlint
- contextcheck
linters-settings:
Expand Down Expand Up @@ -51,28 +47,37 @@ linters-settings:
- name: error-naming
- name: if-return
- name: increment-decrement
# - name: var-naming
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
- name: exported
- name: empty-block
- name: superfluous-else
# - name: unused-parameter
- name: unreachable-code
- name: redefines-builtin-id
- name: waitgroup-by-value
- name: unconditional-recursion
- name: struct-tag
- name: string-format
- name: string-of-int
- name: range-val-address
- name: range-val-in-closure
- name: modifies-value-receiver
- name: modifies-parameter
- name: identical-branches
- name: get-return
# - name: flag-parameter
# - name: early-return
- name: defer
- name: constant-logical-expr
# - name: confusing-naming
# - name: confusing-results
- name: bool-literal-in-expr
- name: atomic
12 changes: 6 additions & 6 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
golang 1.18.2
nodejs 14.19.0
golang 1.19
nodejs 14.20.0
ginkgo 2.1.4
k3d 5.4.1
act 0.2.26
golangci-lint 1.46.2
actionlint 1.6.13
k3d 5.4.6
act 0.2.30
golangci-lint 1.49.0
actionlint 1.6.17
shellcheck 0.8.0
5 changes: 3 additions & 2 deletions actions/soak_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import (

// BuildGoTests builds the go tests using native go cross-compilation to run, and returns a path to the test executable
// along with its size in bytes.
// Note: currentProjectRootPath and currentSoakTestRootPath are not interchangeable with utils.ProjectRoot and utils.SoakRoot
// when running in outside repositories. Keep an eye on when you need paths leading to this go package vs the current running project.
//
// Note: currentProjectRootPath and currentSoakTestRootPath are not interchangeable with utils.ProjectRoot and utils.SoakRoot
// when running in outside repositories. Keep an eye on when you need paths leading to this go package vs the current running project.
func BuildGoTests(executablePath, testsPath, projectRootPath string) (string, int64, error) {
logging.Init()
absExecutablePath, err := filepath.Abs(executablePath)
Expand Down
3 changes: 2 additions & 1 deletion gauntlet/gauntlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ type ExecCommandOptions struct {
}

// ExecCommand Executes a gauntlet command with the provided arguments.
// It will also check for any errors you specify in the output via the errHandling slice.
//
// It will also check for any errors you specify in the output via the errHandling slice.
func (g *Gauntlet) ExecCommand(args []string, options ExecCommandOptions) (string, error) {
output := ""
// append gauntlet and network to args since it is always needed
Expand Down
1 change: 1 addition & 0 deletions testsetups/remote_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func StartRemoteControlServer(name string, stopChan chan struct{}) {

// Start listening for shutdown calls
go func() {
//nolint:gosec
log.Error().Err(http.ListenAndServe(fmt.Sprintf(":%s", accessPort), router)).Msg("Error running remote control server")
}()

Expand Down