Skip to content

chore: setup Storybook with updated configuration #29

chore: setup Storybook with updated configuration

chore: setup Storybook with updated configuration #29

Workflow file for this run

name: Frontend SonarCloud Analysis
on:
push:
branches:
- main
- develop
paths:
- "frontend/**"
- ".github/workflows/frontendSonar.yml"
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- develop
paths:
- "frontend/**"
jobs:
sonarcloud:
name: SonarCloud Analysis
runs-on: ubuntu-latest
timeout-minutes: 15
if: >
github.event_name == 'push' ||
(
github.event_name == 'pull_request' &&
(
startsWith(github.head_ref, 'FE_') ||
startsWith(github.head_ref, 'feature/') ||
startsWith(github.head_ref, 'BE_FE_') ||
startsWith(github.head_ref, 'Doc_') ||
startsWith(github.head_ref, 'FE_BE_') ||
startsWith(github.head_ref, 'bugfix/')
) &&
github.event.pull_request.merged == false
)
defaults:
run:
working-directory: ./frontend
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: './frontend/package-lock.json'
- name: Install dependencies
run: npm ci
- name: Run tests with coverage
run: npm run test:coverage
env:
CI: true
- name: Build application
run: npm run build
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.BARBER_PRO_SONAR_TOKEN_FRONTEND }}
with:
projectBaseDir: ./frontend