Skip to content

Main Workflow

Main Workflow #40

Workflow file for this run

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/
-Dsonar.qualitygate.wait=true
${{ github.event_name != 'pull_request' && format('-Dsonar.branch.name={0}', github.ref_name) || '' }}
-Dsonar.verbose=true
- name: Run echo
run: |
echo "Done ${{ github.ref_name }}"