Skip to content

chore: add codecov into the repository #2

chore: add codecov into the repository

chore: add codecov into the repository #2

name: Report Code Coverage
on:
workflow_call:
pull_request:
types: ['opened', 'reopened', 'synchronize']
jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.5.3
with:
fetch-depth: 1
- name: Setup Node
uses: actions/setup-node@v3.7.0
with:
node-version-file: .nvmrc
cache: 'npm'
- name: Install Dependencies
run: yarn install
- name: Run Tests & Coverage
run: |
npm run test-coverage
# - name: Run Lint Checks
# run: |
# npm run check:lint
# npm run lint:fix
- name: Upload Coverage Reports to Codecov
if: always()
uses: codecov/codecov-action@v3.1.4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage
- name: Fix filesystem paths in generated reports
if: always()
run: |
sed -i 's+home/runner/work/rudder-looker-actions/rudder-looker-actions+/github/workspace+g' coverage/lcov.info
# sed -i 's+/home/runner/work/rudder-auth/rudder-auth+/github/workspace+g' reports/eslint.json
# - name: SonarCloud Scan
# if: always()
# uses: SonarSource/sonarcloud-github-action@v2.0.0
# env:
# GITHUB_TOKEN: ${{ secrets.PAT }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}