Skip to content

Commit

Permalink
feat: add sonarcloud (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkykadir authored Jul 20, 2023
1 parent 3858e4e commit 56d9974
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: test-scan
on: push

jobs:
sonarcloud_unit-tests:
name: sonarcloud_unit-tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Unit test
run: yarn test:unit

- name: Cleanup for SonarCloud
run: rm -rf ./node_modules .github .vscode .tmp

- name: Upload coverage
uses: actions/upload-artifact@v3
with:
name: test-coverage
path: ${{ github.workspace }}/coverage
retention-days: 2

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
21 changes: 21 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
sonar.projectKey=gelato-network_web3-functions-sdk
sonar.organization=gelato-network

sonar.javascript.lcov.reportPaths=./coverage/lcov.info

sonar.qualitygate.wait=true

sonar.exclusions=**\*spec.ts
sonar.coverage.exclusions=**\*spec.ts
sonar.cpd.exclusions=**\*spec.ts

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=web3-functions-sdk
#sonar.projectVersion=1.0


# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
#sonar.sources=.

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8

0 comments on commit 56d9974

Please sign in to comment.