-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (50 loc) · 1.65 KB
/
run-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# This workflow will run for all PRs opened against master
name: Run Tests
on:
- pull_request
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: cache node modules
uses: actions/cache@v1
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 install --force
- name: cypress install
run: npx cypress install
- name: test
run: npm test
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: .
args: >
-Dsonar.organization=tyktechnologies
-Dsonar.projectKey=TykTechnologies_tyk-ui
-Dsonar.sources=./src
-Dsonar.coverage.exclusions=./cypress/**/*.js,**/*.test.js,./src/form/components/Combobox/*.js,./src/form/components/redux-form/**/*.js
-Dsonar.test.inclusions=**/*.test.js
-Dsonar.tests=./src
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.eslint.eslintconfigpath=.eslintrc
env:
CI: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}