-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
148 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: SonarQube Scan | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
pull_request: | ||
|
||
jobs: | ||
wait_for_workflows: | ||
name: Wait for workflows | ||
runs-on: ubuntu-latest | ||
if: always() | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} | ||
|
||
- name: Wait for Workflows | ||
id: wait | ||
uses: smartcontractkit/chainlink-github-actions/utils/wait-for-workflows@main | ||
with: | ||
max-timeout: "1200" | ||
polling-interval: "30" | ||
exclude-workflow-names: "Amarna Analysis,Changesets,Integration Contracts (Vendor, Examples),Integration Gauntlet,Integration Tests Publish,Integration Tests - Smoke,Integration Tests - Soak,Build and push on-chain monitor image to ECR,Contracts,Lint" | ||
exclude-workflow-ids: "" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
env: | ||
DEBUG: "true" | ||
|
||
sonarqube: | ||
name: SonarQube Scan | ||
needs: [ wait_for_workflows ] | ||
runs-on: ubuntu-latest | ||
if: always() | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v3 | ||
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 | ||
uses: dawidd6/action-download-artifact@v2.27.0 | ||
with: | ||
workflow: relayer.yml | ||
workflow_conclusion: "" | ||
name_is_regexp: true | ||
name: go-unit-tests-results | ||
if_no_artifact_found: warn | ||
|
||
- name: Download Golangci Relayer report | ||
uses: dawidd6/action-download-artifact@v2.27.0 | ||
with: | ||
workflow: golangci-lint.yml | ||
workflow_conclusion: "" | ||
name_is_regexp: true | ||
name: golangci-lint-relayer-report | ||
if_no_artifact_found: warn | ||
|
||
- name: Download Golangcio Ops report | ||
uses: dawidd6/action-download-artifact@v2.27.0 | ||
with: | ||
workflow: golangci-lint.yml | ||
workflow_conclusion: "" | ||
name_is_regexp: true | ||
name: golangci-lint-ops-report | ||
if_no_artifact_found: warn | ||
|
||
- name: Download Golangci-lint Integration tests report | ||
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: Set SonarQube Report Paths | ||
id: sonarqube_report_paths | ||
shell: bash | ||
run: | | ||
{ | ||
echo "sonarqube_tests_report_paths=$(find . -type f -name output.txt | paste -sd "," -)" | ||
echo "sonarqube_coverage_report_paths=$(find . -type f -name '*coverage.txt' | paste -sd "," -)" | ||
echo "sonarqube_golangci_report_paths=$(find . -type f -name 'golangci-*-report.xml' -printf "%p,")" | ||
} >> "$GITHUB_OUTPUT" | ||
- name: SonarQube Scan | ||
uses: sonarsource/sonarqube-scan-action@a6ba0aafc293e03de5437af7edbc97f7d3ebc91a # v1.2.0 | ||
with: | ||
args: > | ||
-Dsonar.go.tests.reportPaths=${{ steps.sonarqube_report_paths.outputs.sonarqube_tests_report_paths }} | ||
-Dsonar.go.coverage.reportPaths=${{ steps.sonarqube_report_paths.outputs.sonarqube_coverage_report_paths }} | ||
-Dsonar.go.golangci-lint.reportPaths=${{ steps.sonarqube_report_paths.outputs.sonarqube_golangci_report_paths }} | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# required (may be found under "Project Information" in SonarQube) | ||
sonar.projectKey=smartcontractkit_chainlink-starknet | ||
sonar.sources=. | ||
|
||
# Full exclusions from the static analysis | ||
sonar.exclusions=**/vendor/**/*, **/contracts/**/*, **/mocks/**/*, **/examples/**/*, **/node_modules/**/*, **/docs/**/*, **/scripts/**/*, **/*.config.ts, **/*.config.js, **/*.txt | ||
# Coverage exclusions | ||
sonar.coverage.exclusions=**/*.test.ts, **/*_test.go, **/integration-tests/**/*, **/ops/**/*, **/test/**/*, **/testdata/**/* | ||
|
||
# Tests' root folder, inclusions (tests to check and count) and exclusions | ||
sonar.tests=. | ||
sonar.test.inclusions=**/*_test.go, **/*.test.ts, **/test/**/* | ||
sonar.test.exclusions=**/integration-tests/**/* |