Merge pull request #44 from catenax-ng/fix/trivy_findings #12
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: "Sonar Cloud Workflow" | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
paths: | |
- 'src/**' | |
- 'package.json' | |
- 'Dockerfile' | |
workflow_call: | |
secrets: | |
SONAR_TOKEN: | |
required: true | |
jobs: | |
Analysis: | |
name: Analyse | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [ 16.x ] | |
steps: | |
- uses: actions/checkout@v2 | |
# Add this step to remove the cache | |
- name: Clear cache | |
run: | | |
rm -rf node_modules | |
rm -f package-lock.json | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Run npm install | |
run: npm install --legacy-peer-deps | |
- name: Build and analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: npm run coverage | |
- name: Test | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |