diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 8e9f95930..d41b1b1d4 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -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 @@ -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 - 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 \ No newline at end of file + 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/tool-versions-to-env-action@v1.0.8 + 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 + - 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/tool-versions-to-env-action@v1.0.8 + 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 + - 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 \ No newline at end of file diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml index 81430e0e8..bb1f39535 100644 --- a/.github/workflows/sonar-scan.yml +++ b/.github/workflows/sonar-scan.yml @@ -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/action-download-artifact@v2.27.0 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/action-download-artifact@v2.27.0 + 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/action-download-artifact@v2.27.0 + 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/action-download-artifact@v2.27.0 with: workflow: relay.yml diff --git a/Makefile b/Makefile index 7ca729aa9..c19ab49ff 100644 --- a/Makefile +++ b/Makefile @@ -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 \ No newline at end of file