Skip to content

Commit

Permalink
add coverage to sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbalfour committed Sep 21, 2023
1 parent a16e2f2 commit 10cd2ec
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/main-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Main merge

on:
push:
branches:
- main

jobs:
merge:
name: sonar
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: yarn
run: yarn

- name: Unit Test
run: yarn test

- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
8 changes: 8 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Yarn
run: yarn
Expand All @@ -30,3 +32,9 @@ jobs:

- name: Unit Test
run: yarn test

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get Tag
uses: olegtarasov/get-tag@v2.1
Expand Down
2 changes: 1 addition & 1 deletion packages/custom-resource-wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"scripts": {
"check": "npx tsc",
"lint": "npx eslint",
"test": "npx jest",
"test": "cd ../ && yarn test packages/custom-resource-wrapper",
"build": "reapit-cdk-tsup",
"prepack": "reapit-version-package && yarn build"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/userpool-domain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build": "reapit-cdk-tsup --lambda",
"check": "npx tsc",
"lint": "npx eslint",
"test": "npx jest",
"test": "cd ../ && yarn test packages/userpool-domain",
"prepack": "reapit-version-package && yarn build"
},
"publishConfig": {
Expand Down
3 changes: 3 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sonar.organization=reapit
sonar.projectKey=reapit_ts-cdk-constructs
sonar.javascript.lcov.reportPaths=./coverage/lcov.info

0 comments on commit 10cd2ec

Please sign in to comment.