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
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- feature/* | |
pull_request: | |
types: [opened, synchronize, reopened] | |
name: Main Workflow | |
jobs: | |
sonarcloud: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
- name: Run tests | |
run: | | |
npm ci | |
npm run test | |
echo "${{ github.ref_name }}" | |
- name: SonarCloud Scan | |
uses: sonarsource/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: > | |
-Dsonar.organization=retejs | |
-Dsonar.projectKey=retejs_${{ github.event.repository.name }} | |
-Dsonar.sources=src/ | |
-Dsonar.test.exclusions=tests/** | |
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info | |
-Dsonar.tests=tests/ | |
${{ github.event_name != 'pull_request' && format('-Dsonar.branch.name={0}', github.ref) || '' }} | |
-Dsonar.verbose=true |