Ensure Functions Toolkit works for non-standard chains #165
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
name: SonarQube Scan | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
wait_for_workflows: | |
name: Wait for workflows | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
with: | |
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} | |
- name: Wait for workflows | |
uses: smartcontractkit/chainlink-github-actions/utils/wait-for-workflows@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19 | |
with: | |
max-timeout: '900' | |
polling-interval: '30' | |
exclude-workflow-names: 'Package Artifact Tests' | |
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@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
with: | |
fetch-depth: 0 # fetches all history for all tags and branches to provide more metadata for sonar reports | |
- name: Download ESLint report | |
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 | |
with: | |
workflow: lint.yaml | |
workflow_conclusion: '' | |
name: eslint-report | |
if_no_artifact_found: warn | |
- name: Download tests report | |
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 | |
with: | |
workflow: test.yaml | |
workflow_conclusion: '' | |
name: unit-tests-coverage | |
if_no_artifact_found: warn | |
- name: Set SonarQube Report Paths | |
if: always() | |
id: sonarqube_report_paths | |
shell: bash | |
run: | | |
echo "sonarqube_coverage_report_paths=$(find -type f -name 'lcov.info' -printf "%p,")" >> $GITHUB_OUTPUT | |
echo "sonarqube_eslint_report_paths=$(find -type f -name 'eslint-report.json' -printf "%p")" >> $GITHUB_OUTPUT | |
- name: Update ESLint report symlinks | |
continue-on-error: true | |
run: sed -i 's+/home/runner/work/functions-toolkit/functions-toolkit/+/github/workspace/+g' ${{ steps.sonarqube_report_paths.outputs.sonarqube_eslint_report_paths }} | |
- name: SonarQube Scan | |
if: always() | |
uses: sonarsource/sonarqube-scan-action@86fe81775628f1c6349c28baab87881a2170f495 # v2.1.0 | |
with: | |
args: > | |
-Dsonar.javascript.lcov.reportPaths=${{ steps.sonarqube_report_paths.outputs.sonarqube_coverage_report_paths }} | |
-Dsonar.eslint.reportPaths=${{ steps.sonarqube_report_paths.outputs.sonarqube_eslint_report_paths }} | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} |