Skip to content

Commit

Permalink
Added lint tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smickovskid committed Sep 11, 2023
1 parent 6c82107 commit 9e3da7f
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 10 deletions.
60 changes: 53 additions & 7 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
pull_request:

jobs:
golang_lint:
name: Golang Lint
golang_lint_ops:
name: Golang Lint Ops
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand All @@ -20,12 +20,58 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v${{ steps.tool-versions.outputs.golangci-lint_version }}
args: --enable=gofmt --tests=false --exclude-use-default --timeout=5m0s
only-new-issues: true
run: make lint-go-ops

Check failure on line 23 in .github/workflows/golangci-lint.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/golangci-lint.yml#L23

input "run" is not defined in action "golangci/golangci-lint-action@v3". available inputs are "args", "github-token", "only-new-issues", "skip-build-cache", "skip-cache", "skip-pkg-cache", "version", "working-directory" [action]
Raw output
.github/workflows/golangci-lint.yml:23:11: input "run" is not defined in action "golangci/golangci-lint-action@v3". available inputs are "args", "github-token", "only-new-issues", "skip-build-cache", "skip-cache", "skip-pkg-cache", "version", "working-directory" [action]
- name: Store lint report artifact
if: always()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: golangci-lint-report
path: ./golangci-lint-report.xml
name: golangci-lint-ops-report
path: ./ops/golangci-lint-ops-report.xml

golang_lint_integration_tests:
name: Golang Lint Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: smartcontractkit/[email protected]
id: tool-versions
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
check-latest: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
run: make lint-go-integration-tests

Check failure on line 47 in .github/workflows/golangci-lint.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/golangci-lint.yml#L47

input "run" is not defined in action "golangci/golangci-lint-action@v3". available inputs are "args", "github-token", "only-new-issues", "skip-build-cache", "skip-cache", "skip-pkg-cache", "version", "working-directory" [action]
Raw output
.github/workflows/golangci-lint.yml:47:11: input "run" is not defined in action "golangci/golangci-lint-action@v3". available inputs are "args", "github-token", "only-new-issues", "skip-build-cache", "skip-cache", "skip-pkg-cache", "version", "working-directory" [action]
- name: Store lint report artifact
if: always()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: golangci-lint-integration-tests-report
path: ./integration-tests/golangci-lint-integration-tests-report.xml

golang_lint_relay:
name: Golang Lint Relay tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: smartcontractkit/[email protected]
id: tool-versions
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
check-latest: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
run: make lint-go-relay

Check failure on line 71 in .github/workflows/golangci-lint.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/golangci-lint.yml#L71

input "run" is not defined in action "golangci/golangci-lint-action@v3". available inputs are "args", "github-token", "only-new-issues", "skip-build-cache", "skip-cache", "skip-pkg-cache", "version", "working-directory" [action]
Raw output
.github/workflows/golangci-lint.yml:71:11: input "run" is not defined in action "golangci/golangci-lint-action@v3". available inputs are "args", "github-token", "only-new-issues", "skip-build-cache", "skip-cache", "skip-pkg-cache", "version", "working-directory" [action]
- name: Store lint report artifact
if: always()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: golangci-lint-relay-report
path: ./pkg/golangci-lint-relay-report.xml
24 changes: 21 additions & 3 deletions .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,34 @@ jobs:
with:
fetch-depth: 0 # fetches all history for all tags and branches to provide more metadata for sonar reports

- name: Download Golangci unit tests reports
- name: Download Golangci ops reports
uses: dawidd6/[email protected]
with:
workflow: golangci-lint.yml
workflow_conclusion: ""
name_is_regexp: true
name: golangci-lint-report
name: golangci-lint-ops-report
if_no_artifact_found: warn

- name: Download Golangci Relayer report
- name: Download Golangci integration tests reports
uses: dawidd6/[email protected]
with:
workflow: golangci-lint.yml
workflow_conclusion: ""
name_is_regexp: true
name: golangci-lint-integration-tests-report
if_no_artifact_found: warn

- name: Download Golangci relay reports
uses: dawidd6/[email protected]
with:
workflow: golangci-lint.yml
workflow_conclusion: ""
name_is_regexp: true
name: golangci-lint-relay-report
if_no_artifact_found: warn

- name: Download Relayer unit tests report
uses: dawidd6/[email protected]
with:
workflow: relay.yml
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,15 @@ gomodtidy:
go mod tidy
cd ./integration-tests && go mod tidy
cd ./ops && go mod tidy

.PHONY: lint-go-ops
lint-go-ops:
cd ./ops && golangci-lint --color=always --out-format checkstyle:golangci-lint-ops-report.xml run

.PHONY: lint-go-integration-tests
lint-go-integration-tests:
cd ./integration-tests && golangci-lint --color=always --out-format checkstyle:golangci-lint-integration-tests-report.xml run

.PHONY: lint-go-relay
lint-go-relay:
cd ./pkg && golangci-lint --color=always --out-format checkstyle:golangci-lint-relay-report.xml run

0 comments on commit 9e3da7f

Please sign in to comment.