[TT-16670] added path base scanner #341
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will run for all PRs opened against master | |
| name: Run Tests | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| permissions: | |
| contents: read | |
| jobs: | |
| dep-guard: | |
| uses: TykTechnologies/github-actions/.github/workflows/dependency-guard.yml@d3fa20888fa2878e877e22bb7702141217290e7c # main | |
| permissions: | |
| contents: read | |
| test: | |
| needs: [dep-guard] | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| node-version: [20.x] | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: cache node modules | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-test-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-test-${{ matrix.node-version }} | |
| ${{ runner.os }}- | |
| - name: install | |
| run: npm config set //registry.npmjs.org/:_authToken "${{ secrets. NPM_TOKEN }}" && npm ci --ignore-scripts && npm install esbuild@0.21.5 | |
| - name: cypress install | |
| run: npx cypress install | |
| - name: test | |
| run: npm test | |
| - name: SonarCloud Scan | |
| uses: sonarsource/sonarcloud-github-action@ba3875ecf642b2129de2b589510c81a8b53dbf4e # master | |
| with: | |
| projectBaseDir: . | |
| args: > | |
| -Dsonar.organization=tyktechnologies | |
| -Dsonar.projectKey=TykTechnologies_tyk-ui | |
| -Dsonar.sources=./src | |
| -Dsonar.exclusions=src/common/sass/fontawesome.scss,src/common/sass/tykon.scss | |
| -Dsonar.coverage.exclusions=cypress/**/*.js,**/*.test.js,src/form/components/Combobox/**/*.js,src/form/components/Input/**/*.js,src/form/components/EditableList/**/*.js,src/form/redux-form/**/*.js,src/hooks/**/*,src/utils/**/* | |
| -Dsonar.cpd.exclusions=**/*.test.js,src/form/redux-form/**/*,src/common/fonts/**/*,src/form/components/Combobox/*.js,src/form/components/Input/*.js,src/form/components/EditableList/**/*.js,src/form/redux-form/**/*.js,src/hooks/**/*,src/utils/**/* | |
| -Dsonar.test.inclusions=**/*.test.js | |
| -Dsonar.tests=./src | |
| -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info | |
| -Dsonar.eslint.eslintconfigpath=.eslintrc | |
| -Dsonar.issue.ignore.multicriteria=S6847,S6819,S3358 | |
| -Dsonar.issue.ignore.multicriteria.S6847.ruleKey=javascript:S6847 | |
| -Dsonar.issue.ignore.multicriteria.S6847.resourceKey=**/* | |
| -Dsonar.issue.ignore.multicriteria.S6819.ruleKey=javascript:S6819 | |
| -Dsonar.issue.ignore.multicriteria.S6819.resourceKey=**/* | |
| -Dsonar.issue.ignore.multicriteria.S3358.ruleKey=javascript:S3358 | |
| -Dsonar.issue.ignore.multicriteria.S3358.resourceKey=**/* | |
| env: | |
| CI: true | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |