Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
jobs:
sonarqube:
name: SonarQube
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -19,6 +18,7 @@ jobs:
# so instead we get this mess:
- name: 'Download coverage report'
uses: actions/github-script@v3.1.0
if: github.event.workflow_run.conclusion == 'success'
with:
script: |
const artifacts = await github.actions.listWorkflowRunArtifacts({
Expand All @@ -40,6 +40,7 @@ jobs:

- name: Extract Artifacts
run: unzip coverage.zip && rm coverage.zip
if: github.event.workflow_run.conclusion == 'success'

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ develop, main, master ]
jobs:
jest:
name: Jest with Codecov
name: Jest
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -31,9 +31,15 @@ jobs:
run: "yarn coverage"

- name: Upload Artifact
if: failure()
uses: actions/upload-artifact@v2
with:
name: coverage
path: |
test-report.xml

- name: Upload coverage
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false
verbose: true
override_commit: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"lint:types": "tsc --noEmit",
"test": "jest",
"test:watch": "jest --watch",
"coverage": "yarn test --coverage --coverageProvider=v8"
"coverage": "yarn test --coverage"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -100,7 +100,7 @@
"fake-indexeddb": "^3.1.2",
"jest": "^26.6.3",
"jest-localstorage-mock": "^2.4.6",
"jest-sonar-reporter": "^2.0.0",
"jest-sonar": "^0.2.12",
"jsdoc": "^3.6.6",
"matrix-mock-request": "^1.2.3",
"rimraf": "^3.0.2",
Expand All @@ -118,8 +118,11 @@
],
"coverageReporters": [
"text",
["jest-sonar", {
"outputDirectory": ".",
"outputName": "test-report.xml"
}],
"json"
],
"testResultsProcessor": "jest-sonar-reporter"
]
}
}
3 changes: 3 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ sonar.sources=src
sonar.tests=spec
sonar.exclusions=docs,examples,git-hooks

sonar.typescript.tsconfigPath=./tsconfig.json
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.coverage.exclusions=spec/*.ts
sonar.testExecutionReportPaths=test-report.xml
21 changes: 11 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3146,6 +3146,11 @@ end-of-stream@^1.1.0:
dependencies:
once "^1.4.0"

entities@^2.1.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55"
integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==

entities@~2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5"
Expand Down Expand Up @@ -5000,12 +5005,13 @@ jest-snapshot@^26.6.2:
pretty-format "^26.6.2"
semver "^7.3.2"

jest-sonar-reporter@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/jest-sonar-reporter/-/jest-sonar-reporter-2.0.0.tgz#faa54a7d2af7198767ee246a82b78c576789cf08"
integrity sha512-ZervDCgEX5gdUbdtWsjdipLN3bKJwpxbvhkYNXTAYvAckCihobSLr9OT/IuyNIRT1EZMDDwR6DroWtrq+IL64w==
jest-sonar@^0.2.12:
version "0.2.12"
resolved "https://registry.yarnpkg.com/jest-sonar/-/jest-sonar-0.2.12.tgz#9843cac11f65c997b03a6c94a57571f50decc02b"
integrity sha512-8hZO3rhxVobJkMhyuEgsZxfj0QQucCa+dkXVJ3ckz+Gi180F2ET12GwEGP/j4z1owc08Z2JgIt2Qlgl06+3asQ==
dependencies:
xml "^1.0.1"
entities "^2.1.0"
strip-ansi "^6.0.0"

jest-util@^26.6.2:
version "26.6.2"
Expand Down Expand Up @@ -7977,11 +7983,6 @@ xml-name-validator@^3.0.0:
resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==

xml@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=

xmlchars@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb"
Expand Down