Add CI pipeline to test and upload coverage
This commit is contained in:
parent
7efb10bfde
commit
5b2ca86129
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
@ -37,4 +37,24 @@ jobs:
|
||||
run: vercel pull --yes --token=${{ secrets.VERCEL_AUTH_TOKEN }}
|
||||
|
||||
- name: 📦 Build staging app artifacts
|
||||
run: vercel build --token=${{ secrets.VERCEL_AUTH_TOKEN }}
|
||||
run: vercel build --token=${{ secrets.VERCEL_AUTH_TOKEN }}
|
||||
|
||||
test-coverage:
|
||||
name: SonarCloud
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: 🏗 Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: 📦 Test and coverage
|
||||
run: yarn coverage
|
||||
|
||||
- name: 📦 SonarCloud Scan
|
||||
uses: SonarSource/sonarcloud-github-action@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
@ -7,6 +7,7 @@
|
||||
"preview": "vite preview",
|
||||
"test": "vitest",
|
||||
"serve": "vue-cli-service serve",
|
||||
"coverage": "vitest run --coverage",
|
||||
"build-only": "vite build",
|
||||
"type-check": "vue-tsc --noEmit",
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore",
|
||||
@ -34,6 +35,7 @@
|
||||
"@types/qrcode": "^1.5.0",
|
||||
"@vitejs/plugin-vue": "^3.1.2",
|
||||
"@vitejs/plugin-vue-jsx": "^2.0.1",
|
||||
"@vitest/coverage-c8": "^0.28.2",
|
||||
"@vue/eslint-config-prettier": "^7.0.0",
|
||||
"@vue/eslint-config-typescript": "^11.0.0",
|
||||
"@vue/test-utils": "^2.2.7",
|
||||
|
@ -0,0 +1,8 @@
|
||||
sonar.organization=liftlearning
|
||||
sonar.projectKey=liftlearning_P2Pix-Front-End
|
||||
sonar.sources=src/
|
||||
|
||||
sonar.javascript.lcov.reportPaths=coverage/lcov.info
|
||||
|
||||
sonar.exclusions=dist/**
|
||||
sonar.coverage.exclusions=**/*.spec.*
|
@ -9,6 +9,12 @@ export default defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: "jsdom",
|
||||
coverage: {
|
||||
provider: "c8",
|
||||
all: true,
|
||||
src: ["./src"],
|
||||
reporter: ["text", "lcov", "html"],
|
||||
},
|
||||
},
|
||||
plugins: [vue(), vueJsx()],
|
||||
resolve: {
|
||||
|
135
yarn.lock
135
yarn.lock
@ -1362,7 +1362,7 @@
|
||||
js-yaml "^3.13.1"
|
||||
resolve-from "^5.0.0"
|
||||
|
||||
"@istanbuljs/schema@^0.1.2":
|
||||
"@istanbuljs/schema@^0.1.2", "@istanbuljs/schema@^0.1.3":
|
||||
version "0.1.3"
|
||||
resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz"
|
||||
integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==
|
||||
@ -1568,7 +1568,7 @@
|
||||
resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz"
|
||||
integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==
|
||||
|
||||
"@jridgewell/trace-mapping@^0.3.9":
|
||||
"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.9":
|
||||
version "0.3.17"
|
||||
resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz"
|
||||
integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==
|
||||
@ -1865,6 +1865,16 @@
|
||||
resolved "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-3.1.2.tgz"
|
||||
integrity sha512-3zxKNlvA3oNaKDYX0NBclgxTQ1xaFdL7PzwF6zj9tGFziKwmBa3Q/6XcJQxudlT81WxDjEhHmevvIC4Orc1LhQ==
|
||||
|
||||
"@vitest/coverage-c8@^0.28.2":
|
||||
version "0.28.2"
|
||||
resolved "https://registry.yarnpkg.com/@vitest/coverage-c8/-/coverage-c8-0.28.2.tgz#6fc03502b98102a568a49a357bc3fb41d10933c4"
|
||||
integrity sha512-BWiOUk+d5LvK/9pKaYbL8eLng2EFXgTQMH9QN5nOoizWWKXGNO6LjduVpoz8ZQfb8/6tMVhae7SAS+w0zkRkNw==
|
||||
dependencies:
|
||||
c8 "^7.12.0"
|
||||
picocolors "^1.0.0"
|
||||
std-env "^3.3.1"
|
||||
vitest "0.28.2"
|
||||
|
||||
"@vitest/expect@0.28.1":
|
||||
version "0.28.1"
|
||||
resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-0.28.1.tgz#75e81973c907fe7516b78bcfdc99c6f6c07bf714"
|
||||
@ -1874,6 +1884,15 @@
|
||||
"@vitest/utils" "0.28.1"
|
||||
chai "^4.3.7"
|
||||
|
||||
"@vitest/expect@0.28.2":
|
||||
version "0.28.2"
|
||||
resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-0.28.2.tgz#375af32579b3d6b972a1fe0be0e0260ffb84bc7d"
|
||||
integrity sha512-syEAK7I24/aGR2lXma98WNnvMwAJ+fMx32yPcj8eLdCEWjZI3SH8ozMaKQMy65B/xZCZAl6MXmfjtJb2CpWPMg==
|
||||
dependencies:
|
||||
"@vitest/spy" "0.28.2"
|
||||
"@vitest/utils" "0.28.2"
|
||||
chai "^4.3.7"
|
||||
|
||||
"@vitest/runner@0.28.1":
|
||||
version "0.28.1"
|
||||
resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-0.28.1.tgz#f3c72befec05ef9a3565de7de9974b19f2ff7275"
|
||||
@ -1883,6 +1902,15 @@
|
||||
p-limit "^4.0.0"
|
||||
pathe "^1.1.0"
|
||||
|
||||
"@vitest/runner@0.28.2":
|
||||
version "0.28.2"
|
||||
resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-0.28.2.tgz#671c8f489ceac2bcf1bc2d993f9920da10347d3f"
|
||||
integrity sha512-BJ9CtfPwWM8uc5p7Ty0OprwApyh8RIaSK7QeQPhwfDYA59AAE009OytqA3aX0yj1Qy5+k/mYFJS8RJZgsueSGA==
|
||||
dependencies:
|
||||
"@vitest/utils" "0.28.2"
|
||||
p-limit "^4.0.0"
|
||||
pathe "^1.1.0"
|
||||
|
||||
"@vitest/spy@0.28.1":
|
||||
version "0.28.1"
|
||||
resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-0.28.1.tgz#9efdce05273161cd9036f3f520d0e836602b926d"
|
||||
@ -1890,6 +1918,13 @@
|
||||
dependencies:
|
||||
tinyspy "^1.0.2"
|
||||
|
||||
"@vitest/spy@0.28.2":
|
||||
version "0.28.2"
|
||||
resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-0.28.2.tgz#74d970601eebc41d48e685323b2853b2c88f8db4"
|
||||
integrity sha512-KlLzTzi5E6tHcI12VT+brlY1Pdi7sUzLf9+YXgh80+CfLu9DqPZi38doBBAUhqEnW/emoLCMinPMMoJlNAQZXA==
|
||||
dependencies:
|
||||
tinyspy "^1.0.2"
|
||||
|
||||
"@vitest/utils@0.28.1":
|
||||
version "0.28.1"
|
||||
resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-0.28.1.tgz#01c347803dff8c02d7b097210f3749987e5b2ce6"
|
||||
@ -1901,6 +1936,17 @@
|
||||
picocolors "^1.0.0"
|
||||
pretty-format "^27.5.1"
|
||||
|
||||
"@vitest/utils@0.28.2":
|
||||
version "0.28.2"
|
||||
resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-0.28.2.tgz#2d79de7afb44e821a2c7e692bafb40d2cf765bb7"
|
||||
integrity sha512-wcVTNnVdr22IGxZHDgiXrxWYcXsNg0iX2iBuOH3tVs9eme6fXJ0wxjn0/gCpp0TofQSoUwo3tX8LNACFVseDuA==
|
||||
dependencies:
|
||||
cli-truncate "^3.1.0"
|
||||
diff "^5.1.0"
|
||||
loupe "^2.3.6"
|
||||
picocolors "^1.0.0"
|
||||
pretty-format "^27.5.1"
|
||||
|
||||
"@volar/language-core@1.0.9":
|
||||
version "1.0.9"
|
||||
resolved "https://registry.npmjs.org/@volar/language-core/-/language-core-1.0.9.tgz"
|
||||
@ -2487,6 +2533,24 @@ bufferutil@^4.0.1:
|
||||
dependencies:
|
||||
node-gyp-build "^4.3.0"
|
||||
|
||||
c8@^7.12.0:
|
||||
version "7.12.0"
|
||||
resolved "https://registry.yarnpkg.com/c8/-/c8-7.12.0.tgz#402db1c1af4af5249153535d1c84ad70c5c96b14"
|
||||
integrity sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==
|
||||
dependencies:
|
||||
"@bcoe/v8-coverage" "^0.2.3"
|
||||
"@istanbuljs/schema" "^0.1.3"
|
||||
find-up "^5.0.0"
|
||||
foreground-child "^2.0.0"
|
||||
istanbul-lib-coverage "^3.2.0"
|
||||
istanbul-lib-report "^3.0.0"
|
||||
istanbul-reports "^3.1.4"
|
||||
rimraf "^3.0.2"
|
||||
test-exclude "^6.0.0"
|
||||
v8-to-istanbul "^9.0.0"
|
||||
yargs "^16.2.0"
|
||||
yargs-parser "^20.2.9"
|
||||
|
||||
cac@^6.7.14:
|
||||
version "6.7.14"
|
||||
resolved "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz"
|
||||
@ -2692,7 +2756,7 @@ cross-spawn@^6.0.5:
|
||||
shebang-command "^1.2.0"
|
||||
which "^1.2.9"
|
||||
|
||||
cross-spawn@^7.0.2, cross-spawn@^7.0.3:
|
||||
cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
|
||||
version "7.0.3"
|
||||
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz"
|
||||
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
|
||||
@ -3488,6 +3552,14 @@ follow-redirects@^1.14.8, follow-redirects@^1.15.0:
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13"
|
||||
integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==
|
||||
|
||||
foreground-child@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-2.0.0.tgz#71b32800c9f15aa8f2f83f4a6bd9bff35d861a53"
|
||||
integrity sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==
|
||||
dependencies:
|
||||
cross-spawn "^7.0.0"
|
||||
signal-exit "^3.0.2"
|
||||
|
||||
form-data@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz"
|
||||
@ -3995,7 +4067,7 @@ istanbul-lib-source-maps@^4.0.0:
|
||||
istanbul-lib-coverage "^3.0.0"
|
||||
source-map "^0.6.1"
|
||||
|
||||
istanbul-reports@^3.1.3:
|
||||
istanbul-reports@^3.1.3, istanbul-reports@^3.1.4:
|
||||
version "3.1.5"
|
||||
resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz"
|
||||
integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==
|
||||
@ -6012,6 +6084,15 @@ v8-to-istanbul@^8.1.0:
|
||||
convert-source-map "^1.6.0"
|
||||
source-map "^0.7.3"
|
||||
|
||||
v8-to-istanbul@^9.0.0:
|
||||
version "9.0.1"
|
||||
resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz#b6f994b0b5d4ef255e17a0d17dc444a9f5132fa4"
|
||||
integrity sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==
|
||||
dependencies:
|
||||
"@jridgewell/trace-mapping" "^0.3.12"
|
||||
"@types/istanbul-lib-coverage" "^2.0.1"
|
||||
convert-source-map "^1.6.0"
|
||||
|
||||
validate-npm-package-license@^3.0.1:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz"
|
||||
@ -6034,6 +6115,20 @@ vite-node@0.28.1:
|
||||
source-map-support "^0.5.21"
|
||||
vite "^3.0.0 || ^4.0.0"
|
||||
|
||||
vite-node@0.28.2:
|
||||
version "0.28.2"
|
||||
resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.28.2.tgz#58b52fc638f86fee9bfe4990abaea7e4d74f6514"
|
||||
integrity sha512-zyiJ3DLs9zXign4P2MD4PQk+7rdT+JkHukgmmS0KuImbCQ7WnCdea5imQVeT6OtUsBwsLztJxQODUsinVr91tg==
|
||||
dependencies:
|
||||
cac "^6.7.14"
|
||||
debug "^4.3.4"
|
||||
mlly "^1.1.0"
|
||||
pathe "^1.1.0"
|
||||
picocolors "^1.0.0"
|
||||
source-map "^0.6.1"
|
||||
source-map-support "^0.5.21"
|
||||
vite "^3.0.0 || ^4.0.0"
|
||||
|
||||
"vite@^3.0.0 || ^4.0.0", vite@^3.1.8:
|
||||
version "3.1.8"
|
||||
resolved "https://registry.npmjs.org/vite/-/vite-3.1.8.tgz"
|
||||
@ -6046,6 +6141,36 @@ vite-node@0.28.1:
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.2"
|
||||
|
||||
vitest@0.28.2:
|
||||
version "0.28.2"
|
||||
resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.28.2.tgz#952e1ad83fbd04ee1bfce634b106a371a5973603"
|
||||
integrity sha512-HJBlRla4Mng0OiZ8aWunCecJ6BzLDA4yuzuxiBuBU2MXjGB6I4zT7QgIBL/UrwGKlNxLwaDC5P/4OpeuTlW8yQ==
|
||||
dependencies:
|
||||
"@types/chai" "^4.3.4"
|
||||
"@types/chai-subset" "^1.3.3"
|
||||
"@types/node" "*"
|
||||
"@vitest/expect" "0.28.2"
|
||||
"@vitest/runner" "0.28.2"
|
||||
"@vitest/spy" "0.28.2"
|
||||
"@vitest/utils" "0.28.2"
|
||||
acorn "^8.8.1"
|
||||
acorn-walk "^8.2.0"
|
||||
cac "^6.7.14"
|
||||
chai "^4.3.7"
|
||||
debug "^4.3.4"
|
||||
local-pkg "^0.4.2"
|
||||
pathe "^1.1.0"
|
||||
picocolors "^1.0.0"
|
||||
source-map "^0.6.1"
|
||||
std-env "^3.3.1"
|
||||
strip-literal "^1.0.0"
|
||||
tinybench "^2.3.1"
|
||||
tinypool "^0.3.0"
|
||||
tinyspy "^1.0.2"
|
||||
vite "^3.0.0 || ^4.0.0"
|
||||
vite-node "0.28.2"
|
||||
why-is-node-running "^2.2.2"
|
||||
|
||||
vitest@^0.28.1:
|
||||
version "0.28.1"
|
||||
resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.28.1.tgz#a87656075e01436c887048efd83a5d32792ce890"
|
||||
@ -6335,7 +6460,7 @@ yaml@^1.10.2:
|
||||
resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz"
|
||||
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
|
||||
|
||||
yargs-parser@20.x, yargs-parser@^20.2.2:
|
||||
yargs-parser@20.x, yargs-parser@^20.2.2, yargs-parser@^20.2.9:
|
||||
version "20.2.9"
|
||||
resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz"
|
||||
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
|
||||
|
Loading…
x
Reference in New Issue
Block a user