Fix : test-coverage workflow action indentation (#8979)

This commit is contained in:
Sachin Chaurasiya 2022-11-23 22:39:22 +05:30 committed by GitHub
parent 5dd18b2a13
commit 0aa29b66ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ permissions:
env: env:
UI_WORKING_DIRECTORY: openmetadata-ui/src/main/resources/ui UI_WORKING_DIRECTORY: openmetadata-ui/src/main/resources/ui
UI_COVERAGE_DIRECTORY: openmetadata-ui/src/main/resources/ui/src/test/unit/coverage UI_COVERAGE_DIRECTORY: openmetadata-ui/src/main/resources/ui/src/test/unit/coverage
concurrency: concurrency:
group: yarn-coverage-${{ github.head_ref || github.run_id }} group: yarn-coverage-${{ github.head_ref || github.run_id }}
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
@ -30,79 +30,78 @@ jobs:
node-version: [16.x] node-version: [16.x]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Wait for the labeler
uses: lewagon/wait-on-check-action@0179dfc359f90a703c41240506f998ee1603f9ea #v1.0.0
if: ${{ github.event_name == 'pull_request_target' }}
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: Team Label
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
- name: Wait for the labeler - name: Verify PR labels
uses: lewagon/wait-on-check-action@0179dfc359f90a703c41240506f998ee1603f9ea #v1.0.0 uses: jesusvasquez333/verify-pr-label-action@v1.4.0
if: ${{ github.event_name == 'pull_request_target' }} if: ${{ github.event_name == 'pull_request_target' }}
with: with:
ref: ${{ github.event.pull_request.head.sha }} github-token: '${{ secrets.GITHUB_TOKEN }}'
check-name: Team Label valid-labels: 'safe to test'
repo-token: ${{ secrets.GITHUB_TOKEN }} pull-request-number: '${{ github.event.pull_request.number }}'
wait-interval: 30 disable-reviews: true # To not auto approve changes
- name: Verify PR labels - uses: actions/checkout@v2
uses: jesusvasquez333/verify-pr-label-action@v1.4.0 with:
if: ${{ github.event_name == 'pull_request_target' }} ref: ${{ github.event.pull_request.head.sha }}
with: # Disabling shallow clone is recommended for improving relevancy of reporting
github-token: '${{ secrets.GITHUB_TOKEN }}' fetch-depth: 0
valid-labels: 'safe to test' - name: Use Node.js ${{ matrix.node-version }}
pull-request-number: '${{ github.event.pull_request.number }}' uses: actions/setup-node@v2
disable-reviews: true # To not auto approve changes with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v2 - name: Install Ubuntu dependencies
with: run: |
ref: ${{ github.event.pull_request.head.sha }} sudo apt-get update
# Disabling shallow clone is recommended for improving relevancy of reporting sudo apt-get install -y unixodbc-dev python3-venv librdkafka-dev gcc libsasl2-dev build-essential libssl-dev libffi-dev \
fetch-depth: 0 librdkafka-dev unixodbc-dev libevent-dev
- name: Use Node.js ${{ matrix.node-version }} sudo make install_antlr_cli
uses: actions/setup-node@v2 - name: Install Yarn Packages
with: working-directory: ${{ env.UI_WORKING_DIRECTORY }}
node-version: ${{ matrix.node-version }} run: yarn install
- name: Install Ubuntu dependencies - name: Run Coverage
run: | working-directory: ${{ env.UI_WORKING_DIRECTORY }}
sudo apt-get update run: yarn test:cov-summary
sudo apt-get install -y unixodbc-dev python3-venv librdkafka-dev gcc libsasl2-dev build-essential libssl-dev libffi-dev \ id: yarn_coverage
librdkafka-dev unixodbc-dev libevent-dev - name: Jest Coverage Comment
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:cov-summary
id: yarn_coverage
- name: Jest Coverage Comment
uses: MishaKav/jest-coverage-comment@main uses: MishaKav/jest-coverage-comment@main
with: with:
hide-comment: true hide-comment: true
coverage-summary-path: ${{env.UI_COVERAGE_DIRECTORY}}/coverage-final.json coverage-summary-path: ${{env.UI_COVERAGE_DIRECTORY}}/coverage-final.json
- name: yarn add sonarqube-scanner - name: yarn add sonarqube-scanner
working-directory: ${{ env.UI_WORKING_DIRECTORY }} working-directory: ${{ env.UI_WORKING_DIRECTORY }}
run: npm install -g sonarqube-scanner run: npm install -g sonarqube-scanner
id: npm_install_sonar_scanner id: npm_install_sonar_scanner
- name: SonarCloud Scan On PR - name: SonarCloud Scan On PR
if: github.event_name == 'pull_request_target' && steps.npm_install_sonar_scanner.outcome == 'success' if: github.event_name == 'pull_request_target' && steps.npm_install_sonar_scanner.outcome == 'success'
working-directory: ${{ env.UI_WORKING_DIRECTORY }} working-directory: ${{ env.UI_WORKING_DIRECTORY }}
run: | run: |
sonar-scanner -Dsonar.host.url=${SONARCLOUD_URL} \ sonar-scanner -Dsonar.host.url=${SONARCLOUD_URL} \
-Dproject.settings=sonar-project.properties \ -Dproject.settings=sonar-project.properties \
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
-Dsonar.pullrequest.branch=${{ github.head_ref }} \ -Dsonar.pullrequest.branch=${{ github.head_ref }} \
-Dsonar.pullrequest.base=main \ -Dsonar.pullrequest.base=main \
-Donar.pullrequest.github.repository=OpenMetadata \ -Donar.pullrequest.github.repository=OpenMetadata \
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} \ -Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} \
-Dsonar.pullrequest.provider=github -Dsonar.pullrequest.provider=github
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.UI_SONAR_TOKEN }} SONAR_TOKEN: ${{ secrets.UI_SONAR_TOKEN }}
SONARCLOUD_URL: https://sonarcloud.io SONARCLOUD_URL: https://sonarcloud.io
- name: SonarCloud Scan - name: SonarCloud Scan
if: github.event_name == 'push' && steps.npm_install_sonar_scanner.outcome == 'success' if: github.event_name == 'push' && steps.npm_install_sonar_scanner.outcome == 'success'
working-directory: ${{ env.UI_WORKING_DIRECTORY }} working-directory: ${{ env.UI_WORKING_DIRECTORY }}
run: | run: |
sonar-scanner -Dsonar.host.url=${SONARCLOUD_URL} \ sonar-scanner -Dsonar.host.url=${SONARCLOUD_URL} \
-Dproject.settings=sonar-project.properties -Dproject.settings=sonar-project.properties
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.UI_SONAR_TOKEN }} SONAR_TOKEN: ${{ secrets.UI_SONAR_TOKEN }}
SONARCLOUD_URL: https://sonarcloud.io SONARCLOUD_URL: https://sonarcloud.io