diff --git a/.github/workflows/main-merge.yml b/.github/workflows/main-merge.yml new file mode 100644 index 0000000..218e09e --- /dev/null +++ b/.github/workflows/main-merge.yml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 523af56..31a61f6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -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 @@ -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 }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9600733..53741c7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 diff --git a/packages/custom-resource-wrapper/package.json b/packages/custom-resource-wrapper/package.json index 902f21f..2016220 100644 --- a/packages/custom-resource-wrapper/package.json +++ b/packages/custom-resource-wrapper/package.json @@ -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" }, diff --git a/packages/userpool-domain/package.json b/packages/userpool-domain/package.json index f668079..61d0a5d 100644 --- a/packages/userpool-domain/package.json +++ b/packages/userpool-domain/package.json @@ -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": { diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..64c832d --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,3 @@ +sonar.organization=reapit +sonar.projectKey=reapit_ts-cdk-constructs +sonar.javascript.lcov.reportPaths=./coverage/lcov.info