diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a1a771..c0cddbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,195 +7,15 @@ on: branches: [ main ] jobs: - test-unit: - runs-on: ubuntu-latest - # needs: build - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v3 - with: - persist-credentials: false - - name: install pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - cache: 'pnpm' - - name : install dependencies - run: make install - - name : build - run: make build - - name : test - run: make test-unit - - name: cleanup - run: sudo chown -R $(whoami):$(id -ng) . - - name: upload coverage from unit tests - uses: actions/upload-artifact@v3 - with: - name: coverage-from-unit-tests - path: | - **/coverage/lcov.info - **/coverage/coverage-final.json - retention-days: 1 - - test-features: - runs-on: ubuntu-latest - # needs: build - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v3 - with: - persist-credentials: false - - name: install pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - cache: 'pnpm' - - name : install dependencies - run: make install - - name : build - run: make build - - name : test - run: make test-features - - name: cleanup - run: sudo chown -R $(whoami):$(id -ng) . - - name: upload coverage from features tests - uses: actions/upload-artifact@v3 - with: - name: coverage-from-features-tests - path: | - **/coverage/features-it/lcov.info - **/coverage/features-it/coverage-final.json - **/coverage/features-it-api/lcov.info - **/coverage/features-it-api/coverage-final.json - **/coverage/features-core-domain/lcov.info - **/coverage/features-core-domain/coverage-final.json - retention-days: 1 - - test-smoke: - runs-on: ubuntu-latest - # needs: build - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v3 - with: - persist-credentials: false - - name: install pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - cache: 'pnpm' - - name : install dependencies - run: make install - - name : build - run: make build - - name : test - run: make test-smoke - - name: cleanup - run: sudo chown -R $(whoami):$(id -ng) . - - name: upload coverage from features tests - uses: actions/upload-artifact@v3 - with: - name: coverage-from-smoke-tests - path: | - **/coverage/smoke/lcov.info - **/coverage/smoke/coverage-final.json - retention-days: 1 - - lint: - runs-on: ubuntu-latest - needs: - - test-unit - - test-features - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v3 - with: - persist-credentials: false - - name: install pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - cache: 'pnpm' - - name : install dependencies - run: make install-offline - - name : build - run: make build - - name : lint - run: make lint - - coverage: - runs-on: ubuntu-latest - needs: - - test-unit - - test-features - - test-smoke - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v3 - with: - persist-credentials: false - - name: download coverage from unit tests - uses: actions/download-artifact@v3 - id: download-coverage-from-unit-tests - with: - name: coverage-from-unit-tests - continue-on-error: true - - name: download coverage from features tests - uses: actions/download-artifact@v3 - id: download-coverage-from-features-tests - with: - name: coverage-from-features-tests - continue-on-error: true - - name: download coverage from smoke tests - uses: actions/download-artifact@v3 - id: download-coverage-from-smoke-tests - with: - name: coverage-from-smoke-tests - continue-on-error: true - - name: install pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - cache: 'pnpm' - - name : install dependencies - run: make install-offline - - # - name: codecov - # uses: codecov/codecov-action@v3 - # with: - # token: ${{ secrets.CODECOV_TOKEN }} - # files: ./coverage/lcov.info # optional - # flags: unittests # optional - # name: codecov-umbrella # optional - # fail_ci_if_error: true # optional (default = false) - # verbose: false # optional (default = false) - - # - uses: SonarSource/sonarcloud-github-action@v2.0.0 - # env: - # SONAR_TOKEN: ${{ env.SONAR_TOKEN }} - \ No newline at end of file + ci: + uses: newlight77/github-actions/.github/workflows/node-ci.yml@main + secrets: + slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} + sonar-token: ${{ secrets.SONAR_TOKEN }} + codecov-token: ${{ secrets.CODECOV_TOKEN }} + with: + with-unit-test: true + with-feature-test: false + with-lint: true + coverage-tool: 'codecov, sonar' + slack-room-id: 'C05UA1LUW1H' diff --git a/package.json b/package.json index 0e9a05d..fb61e18 100755 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "turbo": "^1.11.0" }, "nyc": { - "extends": "./packages/shared-lib/config/nycrc/.nycrc" + "extends": "./packages/shared-lib/nycrc/.nycrc" }, "packageManager": "pnpm@8.8.0" } \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..b654d3f --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,38 @@ +sonar.organization=newlight77 + +# must be unique in a given SonarQube instance +sonar.projectKey=app_react + +# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1. +sonar.projectName=app-react + +# github repository +sonar.pullrequest.github.repository=newlight77/app_react + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +# This property is optional if sonar.modules is set. +sonar.sources=\ + apps/app-react, \ + packages/shared-ui/react-mui-joy + +# Long living branch of the project +sonar.branch.longLivedBranches.regex=(main) + +# Encoding of the source code. Default is default system encoding +sonar.sourceEncoding=UTF-8 + +#lcov report +sonar.javascript.lcov.reportPaths=**/coverage/lcov.info + +sonar.exclusions=\ + **/__tests__/**,\ + **/*.tests.*,\ + **/stories/**,\ + **/__generated__/**,\ + **/__mocks__/**,\ + **/__fixtures__/**,\ + **/.eslintrc.js,\ + +sonar.coverage.exclusions= + **/types/**,\ + **/types.ts,\