Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move to SonarCloud #114

Merged
merged 10 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .github/workflows/sonar.yaml

This file was deleted.

134 changes: 134 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: SonarCloud
on:
workflow_dispatch:
push:
branches:
- master
- develop
pull_request:
types: [opened, synchronize, reopened]

jobs:
# Snap
sonarcloud-snap:
name: SonarCloud snap
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'develop'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.25.1
- uses: actions/setup-node@v3
with:
node-version: 18.13.0
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test snap
run: pnpm nx test:ci @blockchain-lab-um/ssi-snap
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Scan snap
uses: SonarSource/sonarcloud-github-action@master
with:
projectBaseDir: packages/snap
args: >
-Dsonar.organization=blockchain-lab-um
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}

# VC Manager
sonarcloud-vcmanager:
name: SonarCloud VC Manager
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'develop'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.25.1
- uses: actions/setup-node@v3
with:
node-version: 18.13.0
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test snap
run: pnpm nx test:ci @blockchain-lab-um/veramo-vc-manager
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Scan VC Manager
uses: SonarSource/sonarcloud-github-action@master
with:
projectBaseDir: packages/vcmanager
args: >
-Dsonar.organization=blockchain-lab-um
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}

# Connector
sonarcloud-connector:
name: SonarCloud connector
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Scan connector
uses: SonarSource/sonarcloud-github-action@master
with:
projectBaseDir: packages/connector
args: >
-Dsonar.organization=blockchain-lab-um
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}

# Dapp
sonarcloud-dapp:
name: SonarCloud dapp
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Scan dapp
uses: SonarSource/sonarcloud-github-action@master
with:
projectBaseDir: packages/dapp
args: >
-Dsonar.organization=blockchain-lab-um
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}

# Docs
sonarcloud-docs:
name: SonarCloud docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Scan docs
uses: SonarSource/sonarcloud-github-action@master
with:
projectBaseDir: packages/docs
args: >
-Dsonar.organization=blockchain-lab-um
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
4 changes: 2 additions & 2 deletions packages/connector/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sonar.projectKey=connector
sonar.projectName=connector
sonar.projectKey=blockchain-lab-um_connector
sonar.projectName=blockchain-lab-um_connector
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.exclusions=**/node_modules/**,**/*spec.ts,**/*.e2e-spec.ts
Expand Down
7 changes: 7 additions & 0 deletions packages/dapp/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sonar.projectKey=blockchain-lab-um_dapp
sonar.projectName=blockchain-lab-um_dapp
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.exclusions=**/node_modules/**,**/*spec.ts,**/*.e2e-spec.ts
sonar.test.inclusions=**/*spec.ts,**/*.e2e-spec.ts
sonar.javascript.lcov.reportPaths=coverage/lcov.info
4 changes: 2 additions & 2 deletions packages/docs/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sonar.projectKey=docs
sonar.projectName=docs
sonar.projectKey=blockchain-lab-um_docs
sonar.projectName=blockchain-lab-um_docs
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.exclusions=**/node_modules/**,**/*spec.ts,**/*.e2e-spec.ts
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sonar.projectKey=snap
sonar.projectName=snap
sonar.projectKey=blockchain-lab-um_snap
sonar.projectName=blockchain-lab-um_snap
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.exclusions=**/node_modules/**,**/*spec.ts,**/*.e2e-spec.ts
Expand Down
3 changes: 2 additions & 1 deletion packages/vcmanager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"lint:eslint": "eslint .",
"lint:prettier": "prettier . --check",
"prepack": "pnpm build",
"test": "pnpm jest"
"test": "pnpm jest",
"test:ci": "pnpm run test --silent --coverage"
},
"dependencies": {
"@blockchain-lab-um/ssi-snap-types": "*",
Expand Down
4 changes: 2 additions & 2 deletions packages/vcmanager/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sonar.projectKey=vcmanager
sonar.projectName=vcmanager
sonar.projectKey=blockchain-lab-um_vc-manager
sonar.projectName=blockchain-lab-um_vc-manager
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.exclusions=**/node_modules/**,**/*spec.ts,**/*.e2e-spec.ts
Expand Down
17 changes: 0 additions & 17 deletions scripts/sonar/Dockerfile

This file was deleted.

8 changes: 0 additions & 8 deletions scripts/sonar/cleanup.sh

This file was deleted.

25 changes: 0 additions & 25 deletions scripts/sonar/entrypoint.sh

This file was deleted.

97 changes: 0 additions & 97 deletions scripts/sonar/run-sonar.sh

This file was deleted.