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

add CI test for core/scripts #11466

Merged
merged 11 commits into from
Dec 14, 2023
7 changes: 1 addition & 6 deletions .github/actions/golangci-lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,9 @@ runs:
shell: bash
run: mkdir -p core/web/assets && touch core/web/assets/index.html
- name: Build binary
if: ${{ inputs.go-directory == '.' }}
shell: bash
run: go build ./...
- name: Build binary
if: ${{ inputs.go-directory != '.' }}
working-directory: ${{ inputs.go-directory }}
shell: bash
run: go build
run: go build ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/ci-chaincli.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/ci-scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI Scripts

on:
push:
pull_request:

jobs:
golangci:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'schedule' }}
momentmaker marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Golang Lint
uses: ./.github/actions/golangci-lint
with:
name: scripts-lint
go-directory: core/scripts
go-version-file: core/scripts/go.mod
go-module-file: core/scripts/go.sum
gc-basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
gc-host: ${{ secrets.GRAFANA_CLOUD_HOST }}

test:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'schedule' }}
momentmaker marked this conversation as resolved.
Show resolved Hide resolved
name: scripts-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Go
uses: ./.github/actions/setup-go
with:
go-version-file: core/scripts/go.mod
go-module-file: core/scripts/go.sum
- name: Run Tests
shell: bash
run: |
cd core/scripts
go test ./...
momentmaker marked this conversation as resolved.
Show resolved Hide resolved
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@d1618b772a97fd87e6505de97b872ee0b1f1729a # v2.0.2
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: scripts-test
continue-on-error: true
1 change: 1 addition & 0 deletions core/scripts/functions/src/fetching.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"github.com/urfave/cli"

helpers "github.com/smartcontractkit/chainlink/core/scripts/common"
ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big"
"github.com/smartcontractkit/chainlink/v2/core/web/presenters"
)

Expand Down Expand Up @@ -67,7 +68,7 @@
if ocr2BundleIndex == -1 {
helpers.PanicErr(errors.New("node must have EVM OCR2 bundle"))
}
ocr2Bundle := ocr2Bundles[ocr2BundleIndex]

Check failure on line 71 in core/scripts/functions/src/fetching.go

View workflow job for this annotation

GitHub Actions / golangci

shadow: declaration of "ocr2Bundle" shadows declaration at line 18 (govet)
output.Reset()

err = client.ListCSAKeys(&cli.Context{
Expand Down
Loading