OpenMetadata/.github/workflows/yarn-coverage.yml
Ashok Mokshagundam 23f6e18a17
Running All the CI workflows on Release branches along with main branch (#7691)
* Update airflow-apis-tests-3_9.yml

Updated workflows to run on main branch and also on all release branches

* Update cypress-integration-tests-mysql.yml

Updated workflows to run on main branch and also on all release branches

* Update cypress-integration-tests-postgresql.yml

Updated workflows to run on main branch and also on all release branches

* Update docs-tests.yml

Updated workflows to run on main branch and also on all release branches

* Update java-checkstyle.yml

Updated workflows to run on main branch and also on all release branches

* Update maven-build.yml

Updated workflows to run on main branch and also on all release branches

* Update openmetadata-ingestion-core-version-comment.yml

Updated workflows to run on main branch and also on all release branches

* Update py-checkstyle.yml

Updated workflows to run on main branch and also on all release branches

* Update py-generate.yml

Updated workflows to run on main branch and also on all release branche

* Update py-ingestion-core-publish.yml

Updated workflows to run on main branch and also on all release branches

* Update py-tests.yml

Updated workflows to run on main branch and also on all release branches

* Update selenium-noIngestion-tests.yml

Updated workflows to run on main branch and also on all release branches

* Update sync-docs.yml

Updated workflows to run on main branch and also on all release branches

* Update yarn-coverage.yml

Updated workflows to run on main branch and also on all release branches

* Update airflow-apis-tests-3_9.yml

Updated workflows to run on main branch and also on all release branches

* Update cypress-integration-tests-mysql.yml

Updated workflows to run on main branch and also on all release branches

* Update cypress-integration-tests-postgresql.yml

Updated workflows to run on main branch and also on all release branches

* Update docs-tests.yml

Updated workflows to run on main branch and also on all release branches

* Update java-checkstyle.yml

Updated workflows to run on main branch and also on all release branches

* Update maven-build.yml

Updated workflows to run on main branch and also on all release branches

* Update openmetadata-ingestion-core-version-comment.yml

Updated workflows to run on main branch and also on all release branches

* Update py-checkstyle.yml

Updated workflows to run on main branch and also on all release branches

* Update py-tests.yml

Updated workflows to run on main branch and also on all release branches

* Update selenium-noIngestion-tests.yml

Updated workflows to run on main branch and also on all release branches

* Update sync-docs.yml

Updated workflows to run on main branch and also on all release branches
2022-09-26 16:47:35 +05:30

80 lines
3.0 KiB
YAML

name: SonarCloud + Node Yarn Coverage
on:
# Trigger analysis when pushing in master or pull requests, and when creating
# a pull request.
push:
branches:
- main
- '0.[0-9]+.[0-9]+'
paths:
- openmetadata-ui/src/main/resources/ui/**
pull_request_target:
types: [opened, synchronize, reopened]
paths:
- openmetadata-ui/src/main/resources/ui/**
env:
UI_WORKING_DIRECTORY: openmetadata-ui/src/main/resources/ui
concurrency:
group: yarn-coverage-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
coverage-tests:
strategy:
matrix:
node-version: [16.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Ubuntu dependencies
run: |
sudo apt-get update
sudo apt-get install -y unixodbc-dev python3-venv librdkafka-dev gcc libsasl2-dev build-essential libssl-dev libffi-dev \
librdkafka-dev unixodbc-dev libevent-dev
sudo make install_antlr_cli
- name: Install Yarn Packages
working-directory: ${{ env.UI_WORKING_DIRECTORY }}
run: yarn install
- name: Run Coverage
working-directory: ${{ env.UI_WORKING_DIRECTORY }}
run: yarn test:coverage
id: yarn_coverage
- name: yarn add sonarqube-scanner
working-directory: ${{ env.UI_WORKING_DIRECTORY }}
run: npm install -g sonarqube-scanner
id: npm_install_sonar_scanner
- name: SonarCloud Scan On PR
if: github.event_name == 'pull_request_target' && steps.npm_install_sonar_scanner.outcome == 'success'
working-directory: ${{ env.UI_WORKING_DIRECTORY }}
run: |
sonar-scanner -Dsonar.host.url=${SONARCLOUD_URL} \
-Dproject.settings=sonar-project.properties \
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
-Dsonar.pullrequest.branch=${{ github.head_ref }} \
-Dsonar.pullrequest.base=main \
-Donar.pullrequest.github.repository=OpenMetadata \
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} \
-Dsonar.pullrequest.provider=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.UI_SONAR_TOKEN }}
SONARCLOUD_URL: https://sonarcloud.io
- name: SonarCloud Scan
if: github.event_name == 'push' && steps.npm_install_sonar_scanner.outcome == 'success'
working-directory: ${{ env.UI_WORKING_DIRECTORY }}
run: |
sonar-scanner -Dsonar.host.url=${SONARCLOUD_URL} \
-Dproject.settings=sonar-project.properties
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.UI_SONAR_TOKEN }}
SONARCLOUD_URL: https://sonarcloud.io