fix condition sonor #630
Workflow file for this run
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: Pogues Test CI | |
on: | |
push: | |
branches: | |
- '**' | |
jobs: | |
test-build: | |
name: Test & build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: yarn | |
- run: yarn test:coverage | |
- run: yarn build | |
- name: Upload coverage artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage | |
path: coverage/ | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: dist/ | |
sonarcloud: | |
name: SonarCloud Analysis | |
runs-on: ubuntu-latest | |
needs: test-build # Ensure SonarCloud job runs after the test-build job | |
if: ${{ github.event_name == 'pull_request' }} # Only run SonarCloud on pull requests | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download coverage artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage | |
path: coverage | |
- name: SonarCloud Scan | |
uses: sonarsource/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: > | |
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} | |
-Dsonar.pullrequest.branch=${{ github.head_ref }} | |
-Dsonar.pullrequest.base=${{ github.base_ref }} |