chore(deps): bump SonarSource/sonarcloud-github-action from 3.1.0 to 4.0.0 #295
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: Tests | |
on: pull_request | |
jobs: | |
run-tests: | |
name: Run Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install Dependencies | |
run: npm ci | |
- name: Run Tests | |
run: npm run test:no-logging | |
- name: Run Lint Checks | |
run: | | |
npm run check:lint | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
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/rudder-workflow-engine/rudder-workflow-engine+/github/workspace+g' reports/coverage/lcov.info | |
sed -i 's+/home/runner/work/rudder-workflow-engine/rudder-workflow-engine+/github/workspace+g' reports/eslint.json | |
- name: SonarCloud Scan | |
if: always() | |
uses: SonarSource/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |