chore(master): release 5.46.0 (#2006) #1075
This file contains hidden or 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
| # ⚠️ IMPORTANT: This workflow is a template from diplodoc/lint/scaffolding | |
| # Do not edit this file in other packages - it is automatically copied from here. | |
| # To modify this workflow, edit it in diplodoc/devops/lint/scaffolding/.github/workflows/ | |
| # and then run the scaffolding update process. | |
| # | |
| # This workflow is optional: it does not block merging even if it fails (continue-on-error). | |
| name: Coverage | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| pull_request: | |
| branches: | |
| - master | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| coverage: | |
| name: Test coverage | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js and install dependencies | |
| uses: diplodoc-platform/setup-node-action@v1 | |
| with: | |
| node-version: ${{ vars.NODE_VERSION || '24' }} | |
| - name: Run tests with coverage | |
| id: coverage-run | |
| run: | | |
| if node -e "const s=require('./package.json').scripts; process.exit(s && s['test:coverage'] ? 0 : 1)"; then | |
| npm run test:coverage | |
| echo "ran=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "test:coverage script not found, skipping." | |
| echo "ran=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Upload coverage artifact | |
| if: success() && steps.coverage-run.outputs.ran == 'true' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: coverage/ | |
| retention-days: 7 | |
| # Secrets aren't exposed to workflows triggered by pull_request from a fork, | |
| # so SONAR_TOKEN is empty and SonarCloud responds with "Project not found". | |
| # Skip the scan in that case — coverage artifact is still uploaded above. | |
| - name: SonarCloud Scan | |
| if: | | |
| success() && | |
| steps.coverage-run.outputs.ran == 'true' && | |
| (github.event_name != 'pull_request' || | |
| github.event.pull_request.head.repo.full_name == github.repository) | |
| uses: SonarSource/sonarqube-scan-action@v7.0.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |