From c7af035ba777570bd82c9d32a019b767430485d3 Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 09:07:29 +0200 Subject: [PATCH 01/15] fix(action): modified workflow for beta --- .github/workflows/beta.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 3c2e206..043a9c1 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -52,6 +52,7 @@ jobs: sonarcloud: name: SonarCloud + needs: install runs-on: ${{ matrix.os }} strategy: @@ -71,7 +72,7 @@ jobs: semantic-version: name: Semantic Release - needs: install + needs: sonarcloud runs-on: ${{ matrix.os }} strategy: From 03bbefdd2a5bf3a68d58264516f811d68bee066c Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 09:11:09 +0200 Subject: [PATCH 02/15] fix(action): embedded test & coverage --- .github/workflows/beta.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 043a9c1..1651745 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -47,8 +47,8 @@ jobs: - name: Lint run: npm run lint - - name: Test - run: npm run test + - name: Test & Coverage + run: npm run coverage sonarcloud: name: SonarCloud From e5ab88afd40187cf7d132eed8fad802b8225f757 Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 09:14:29 +0200 Subject: [PATCH 03/15] fix(action): rename process --- .github/workflows/beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 1651745..25243e3 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -47,7 +47,7 @@ jobs: - name: Lint run: npm run lint - - name: Test & Coverage + - name: Vitest - Test & Coverage run: npm run coverage sonarcloud: From 37842dce41b41bb4ffa613168280727102556c9c Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 09:20:58 +0200 Subject: [PATCH 04/15] fix(action): rerun workflow if pr was edited --- .github/workflows/beta.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 25243e3..526bba6 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -8,6 +8,7 @@ on: types: - opened - reopened + - edited branches: - 'beta' From 01fbc0ad23f7fd52fe81a23e0c9bae149e300d00 Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 09:29:32 +0200 Subject: [PATCH 05/15] fix(action): upload & download coverage artifact --- .github/workflows/beta.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 526bba6..cd5a4cb 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -51,6 +51,12 @@ jobs: - name: Vitest - Test & Coverage run: npm run coverage + - name: Archive vitest code coverage results + uses: actions/upload-artifact@v4 + with: + name: vitest-code-coverage-report + path: .coverage/ + sonarcloud: name: SonarCloud needs: install @@ -65,6 +71,10 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Download vitest code coverage results + uses: actions/download-artifact@v4 + with: + name: vitest-code-coverage-report - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: From 48207d8c245935e482b198ae809ff4f844c44111 Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 09:34:30 +0200 Subject: [PATCH 06/15] fix(action): artifact build fix --- .github/workflows/beta.yml | 2 +- vitest.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index cd5a4cb..785f933 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -55,7 +55,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: vitest-code-coverage-report - path: .coverage/ + path: ./coverage/**/* sonarcloud: name: SonarCloud diff --git a/vitest.config.js b/vitest.config.js index 2e29984..e9aab45 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -5,7 +5,7 @@ export default defineConfig({ coverage: { provider: 'v8', reporter: ['text', 'json'], - reportsDirectory: './.coverage', + reportsDirectory: './coverage', exclude: [ ...configDefaults.exclude, 'commitlint.config.js', From 74a8b8a34d16ae79dc83ba7fc90498d18a9fe73d Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 09:42:51 +0200 Subject: [PATCH 07/15] fix(action): added new coverage reporter --- vitest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vitest.config.js b/vitest.config.js index e9aab45..f7616bf 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -4,7 +4,7 @@ export default defineConfig({ test: { coverage: { provider: 'v8', - reporter: ['text', 'json'], + reporter: ['text', 'json', 'clover'], reportsDirectory: './coverage', exclude: [ ...configDefaults.exclude, From dd99c2682734d1ed02257be06da3abd77cc0475b Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 09:47:06 +0200 Subject: [PATCH 08/15] fix(action): run beta on sync --- .github/workflows/beta.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 785f933..746a9b5 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -9,8 +9,9 @@ on: - opened - reopened - edited + - synchronize branches: - - 'beta' + - beta concurrency: group: ${{ github.workflow }}-${{ github.ref }} From b6c1d12af89dfec98b9a19dc6af818299eae362c Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 09:52:30 +0200 Subject: [PATCH 09/15] fix(vitest): added lcov as coverage reporter --- vitest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vitest.config.js b/vitest.config.js index f7616bf..55f9bf8 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -4,7 +4,7 @@ export default defineConfig({ test: { coverage: { provider: 'v8', - reporter: ['text', 'json', 'clover'], + reporter: ['text', 'json', 'lcov'], reportsDirectory: './coverage', exclude: [ ...configDefaults.exclude, From 256a8ae5ed67308253b35042dceeb5cb06fec857 Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 09:58:01 +0200 Subject: [PATCH 10/15] fix(sonarcloud): added vitest lcov report to sonar --- .gitignore | 2 +- sonar-project.properties | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4c5146d..e738f7c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ node_modules /.env -/.coverage /.DS_Store +/coverage diff --git a/sonar-project.properties b/sonar-project.properties index 64aa0ab..23b4df9 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,7 +1,8 @@ sonar.projectKey=basics_rxjs-collection sonar.organization=basics -sonar.cpd.exclusions=packages/**/*.test.js +sonar.cpd.exclusions=./packages/**/*.test.js +sonar.javascript.lcov.reportPaths=./coverage/lcov.info # This is the name and version displayed in the SonarCloud UI. #sonar.projectName=rxjs-collection From 97687168e1a5e37b85f977ae3684af3d358716c6 Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 10:09:58 +0200 Subject: [PATCH 11/15] fix(action): test --- .github/workflows/beta.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 746a9b5..d6d2a6e 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -76,6 +76,7 @@ jobs: uses: actions/download-artifact@v4 with: name: vitest-code-coverage-report + run: ls -l - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: From 9ec341a9e278b5dac88ffa5c62a222481fa7ced6 Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 10:12:24 +0200 Subject: [PATCH 12/15] fix(action): test --- .github/workflows/beta.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index d6d2a6e..0eabaf0 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -76,6 +76,7 @@ jobs: uses: actions/download-artifact@v4 with: name: vitest-code-coverage-report + - name: check run: ls -l - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master From decde60ec16c92c14fdc575476f9cc231afd6c2f Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 10:17:44 +0200 Subject: [PATCH 13/15] fix(action): test --- .github/workflows/beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 0eabaf0..0d6f376 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -56,7 +56,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: vitest-code-coverage-report - path: ./coverage/**/* + path: ./coverage/ sonarcloud: name: SonarCloud From 22d626e6b9c3c084cf394782ac1e0b1316d5233a Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 10:30:19 +0200 Subject: [PATCH 14/15] fix(action): download coverage to folder --- .github/workflows/beta.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 0d6f376..9938040 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -76,6 +76,7 @@ jobs: uses: actions/download-artifact@v4 with: name: vitest-code-coverage-report + path: ./coverage/ - name: check run: ls -l - name: SonarCloud Scan From e9ff91c9525ec148657970588cd3b5cd8cd81e95 Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Mon, 16 Sep 2024 10:43:30 +0200 Subject: [PATCH 15/15] fix(action): test --- .github/workflows/beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 9938040..14218b2 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -78,7 +78,7 @@ jobs: name: vitest-code-coverage-report path: ./coverage/ - name: check - run: ls -l + run: cd coverage && find . - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: