Skip to content

chore(deps): bump actions/checkout from 4.1.0 to 4.1.5 #48

chore(deps): bump actions/checkout from 4.1.0 to 4.1.5

chore(deps): bump actions/checkout from 4.1.0 to 4.1.5 #48

name: Tests with lint check and code coverage
on:
workflow_call:
secrets:
SONAR_TOKEN:
required: true
pull_request:
types: ['opened', 'reopened', 'synchronize']
jobs:
coverage:
name: Tests with lint check and code coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.5
with:
fetch-depth: 1
- name: Setup Node
uses: actions/setup-node@v4.0.1
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Run Tests & lint check
run: |
npm run test
npm run check:lint
- name: Upload Coverage Reports to Codecov
uses: codecov/codecov-action@v3.1.4
with:
directory: ./reports/coverage
- name: Update sonar-project.properties
run: |
# Retrieve the version from package.json
version=$(node -e "console.log(require('./package.json').version)")
# Update the sonar-project.properties file with the version
sed -i "s/sonar.projectVersion=.*$/sonar.projectVersion=$version/" sonar-project.properties
- name: Fix filesystem paths in generated reports
if: always()
run: |
sed -i 's+home/runner/work/rudderstack-shopify-tracker/rudderstack-shopify-tracker+/github/workspace+g' reports/coverage/lcov.info
sed -i 's+/home/runner/work/rudderstack-shopify-tracker/rudderstack-shopify-tracker+/github/workspace+g' reports/eslint.json
- name: SonarCloud Scan
if: always()
uses: SonarSource/sonarcloud-github-action@v2.1.1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}