Skip to content

Merge pull request #174 from green-code-initiative/dependabot/npm_and… #361

Merge pull request #174 from green-code-initiative/dependabot/npm_and…

Merge pull request #174 from green-code-initiative/dependabot/npm_and… #361

Workflow file for this run

name: Build and Tests
on:
push:
branches:
- main
paths-ignore:
- '*.md'
- '.github/**/*.yml'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
pull-requests: read # allows SonarCloud to decorate PRs with analysis results
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js defined in .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Test with coverage
run: pnpm coverage
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v5.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}