From 389bb6b465c194f9a86f4e142fc6e14a8c2d1657 Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Tue, 17 Sep 2024 16:34:18 +0200 Subject: [PATCH 1/7] fix(git-action): cleanup --- .github/workflows/beta.yml | 35 +++++++++++++++++++---------------- .github/workflows/feature.yml | 24 +++++++++++++----------- .github/workflows/main.yml | 35 +++++++++++++++++++---------------- 3 files changed, 51 insertions(+), 43 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 98833e0..dd3eb34 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -21,13 +21,14 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/setup-node@v4 + - name: checkout repo + uses: actions/checkout@v4 + + - name: setup node + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - - name: Checkout Repo - uses: actions/checkout@v4 - - name: cache node_modules uses: actions/cache@v4 id: cache @@ -36,17 +37,17 @@ jobs: node_modules key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} - - name: Install Dependencies + - name: install dependencies if: steps.cache.outputs.cache-hit != 'true' run: npm ci - - name: Lint + - name: lint run: npm run lint - - name: Vitest - Test & Coverage + - name: vitest - Test & Coverage run: npm run coverage - - name: Archive vitest code coverage results + - name: archive vitest code coverage results uses: actions/upload-artifact@v4 with: name: vitest-code-coverage-report @@ -63,13 +64,14 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/setup-node@v4 + - name: checkout repo + uses: actions/checkout@v4 + + - name: setup node + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - - name: Checkout Repo - uses: actions/checkout@v4 - - name: cache node_modules uses: actions/cache@v4 id: cache @@ -77,7 +79,7 @@ jobs: path: node_modules key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} - - name: Versioning + - name: release versioning env: GH_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -96,17 +98,18 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - name: checkout repo + 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 + - name: download vitest code coverage results uses: actions/download-artifact@v4 with: name: vitest-code-coverage-report path: ./coverage/ - - name: SonarCloud Scan + - name: SonarCloud scan uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml index fc3ddb2..0e9d2e6 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/feature.yml @@ -21,13 +21,14 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/setup-node@v4 + - name: checkout repo + uses: actions/checkout@v4 + + - name: setup node + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - - name: Checkout Repo - uses: actions/checkout@v4 - - name: cache node_modules uses: actions/cache@v4 id: cache @@ -36,17 +37,17 @@ jobs: node_modules key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} - - name: Install Dependencies + - name: install dependencies if: steps.cache.outputs.cache-hit != 'true' run: npm ci - - name: Lint + - name: lint run: npm run lint - - name: Vitest - Test & Coverage + - name: vitest - test & coverage run: npm run coverage - - name: Archive vitest code coverage results + - name: archive vitest code coverage results uses: actions/upload-artifact@v4 with: name: vitest-code-coverage-report @@ -63,17 +64,18 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - name: checkout repo + 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 + - name: download vitest code coverage results uses: actions/download-artifact@v4 with: name: vitest-code-coverage-report path: ./coverage/ - - name: SonarCloud Scan + - name: SonarCloud scan uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index beb9266..6411ca1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,13 +21,14 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/setup-node@v4 + - name: checkout repo + uses: actions/checkout@v4 + + - name: setup node + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - - name: Checkout Repo - uses: actions/checkout@v4 - - name: cache node_modules uses: actions/cache@v4 id: cache @@ -36,17 +37,17 @@ jobs: node_modules key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} - - name: Install Dependencies + - name: install dependencies if: steps.cache.outputs.cache-hit != 'true' run: npm ci - - name: Lint + - name: lint run: npm run lint - - name: Vitest - Test & Coverage + - name: vitest - Test & Coverage run: npm run coverage - - name: Archive vitest code coverage results + - name: archive vitest code coverage results uses: actions/upload-artifact@v4 with: name: vitest-code-coverage-report @@ -63,13 +64,14 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/setup-node@v4 + - name: checkout repo + uses: actions/checkout@v4 + + - name: setup node + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - - name: Checkout Repo - uses: actions/checkout@v4 - - name: cache node_modules uses: actions/cache@v4 id: cache @@ -77,7 +79,7 @@ jobs: path: node_modules key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} - - name: Versioning + - name: release versioning env: GH_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -96,17 +98,18 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - name: checkout repo + 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 + - name: download vitest code coverage results uses: actions/download-artifact@v4 with: name: vitest-code-coverage-report path: ./coverage/ - - name: SonarCloud Scan + - name: SonarCloud scan uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any From 0c9eb42737d09b14600ad8f4b1ed47f81fd91e12 Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Tue, 17 Sep 2024 16:38:24 +0200 Subject: [PATCH 2/7] fix(git-action): added additional optional install routine --- .github/workflows/beta.yml | 6 +++++- .github/workflows/feature.yml | 2 +- .github/workflows/main.yml | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index dd3eb34..c194674 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -37,7 +37,7 @@ jobs: node_modules key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} - - name: install dependencies + - name: install dependencies (no cache available) if: steps.cache.outputs.cache-hit != 'true' run: npm ci @@ -79,6 +79,10 @@ jobs: path: node_modules key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} + - name: install dependencies (no cache available) + if: steps.cache.outputs.cache-hit != 'true' + run: npm ci + - name: release versioning env: GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml index 0e9d2e6..105d88a 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/feature.yml @@ -37,7 +37,7 @@ jobs: node_modules key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} - - name: install dependencies + - name: install dependencies (no cache available) if: steps.cache.outputs.cache-hit != 'true' run: npm ci diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6411ca1..8ba2380 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,7 +37,7 @@ jobs: node_modules key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} - - name: install dependencies + - name: install dependencies (no cache available) if: steps.cache.outputs.cache-hit != 'true' run: npm ci @@ -79,6 +79,10 @@ jobs: path: node_modules key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} + - name: install dependencies (no cache available) + if: steps.cache.outputs.cache-hit != 'true' + run: npm ci + - name: release versioning env: GH_TOKEN: ${{ secrets.GH_TOKEN }} From e37c8e4490c8539c4502a82e608506a949a5efc6 Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Tue, 17 Sep 2024 16:52:59 +0200 Subject: [PATCH 3/7] fix(git-action): deploy coverage on gh-pages --- .github/workflows/main.yml | 23 +++++++++++++++++++++++ vitest.config.js | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8ba2380..952cf78 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -118,3 +118,26 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + deploy-ghpages: + name: Deploy (GH-Pages) + needs: semantic-version + strategy: + matrix: + os: [ubuntu-latest] + node: [20] + + runs-on: ${{ matrix.os }} + + steps: + - name: download vitest code coverage results + uses: actions/download-artifact@v4 + with: + name: vitest-code-coverage-report + path: ./coverage/ + - name: deploy to gh-pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: coverage + # cname: diff --git a/vitest.config.js b/vitest.config.js index 55f9bf8..ad7d4d7 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -4,7 +4,7 @@ export default defineConfig({ test: { coverage: { provider: 'v8', - reporter: ['text', 'json', 'lcov'], + reporter: ['text', 'json', 'lcov', 'html'], reportsDirectory: './coverage', exclude: [ ...configDefaults.exclude, From f9850eea982dd068b174a7115bd26e3b2f39d8a5 Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Tue, 17 Sep 2024 17:13:36 +0200 Subject: [PATCH 4/7] fix(readme): update --- README.md | 50 +++++++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 37127a1..59baf1e 100644 --- a/README.md +++ b/README.md @@ -10,34 +10,43 @@ [![Renovate - Status][renovate-status-src]][renovate-status-href] [![License][license-src]][license-href] +[![Coverage Report][vitest-coverage-src]][vitest-coverage-href] + --- ## ToDo - evaluation - - [ ] BranchNameLint alternative (https://www.npmjs.com/package/branch-name-lint) - - [ ] SonarLint (https://docs.sonarsource.com/sonarcloud/improving/sonarlint/) - - [ ] ... + - [ ] BranchNameLint alternative (https://www.npmjs.com/package/branch-name-lint) + - [ ] SonarLint (https://docs.sonarsource.com/sonarcloud/improving/sonarlint/) + - [ ] ... - observables + test - - [ ] default fetch - - [ ] window dom (resize, scroll)? - - [ ] ... + - [ ] default fetch + - [ ] window dom (resize, scroll)? + - [ ] ... - operators + test - - [ ] finalize network retry - - [ ] request paginator (full, lazy) - - [ ] ... + - [ ] finalize network retry + - [ ] request paginator (full, lazy) + - [ ] ... - git actions - - [ ] implemented merge strategy - - only beta-branch can be merged into main - - only feature-branches can be merged into beta - - hotfixes can be merged directly into main, but beta will also be updated - - [ ] ... + - [ ] implemented merge strategy + - only beta-branch can be merged into main + - only feature-branches can be merged into beta + - hotfixes can be merged directly into main, but beta will also be updated + - [ ] ... +- git rules + - [ ] main branch can be updated only by pull request from + - [ ] beta branch + - [ ] hotfix branch + - [ ] beta branch can be updated only by pull request from + - [ ] feature branch + - [ ] hotfix branch - sonarcloud - - [ ] finalized config - - [ ] ... + - [ ] finalized config + - [ ] ... - additional git action services - - [ ] evaluate pr agent - - [ ] ... - - [ ] ... + - [ ] evaluate pr agent + - [ ] ... + - [ ] ... [renovate-status-src]: @@ -59,3 +68,6 @@ [npm-downloads-src]: https://img.shields.io/npm/dt/nuxt-booster.svg?style=flat-square [npm-downloads-href]: https://npmjs.com/package/nuxt-booster + +[vitest-coverage-src]: https://img.shields.io/badge/Coverage_Report-2ea44f?logo=vitest&logoColor=%23fff +[vitest-coverage-href]: https://basics.github.io/rxjs-collection/ \ No newline at end of file From e7b495918664a3e8b30ee25f84ef250f3316b85e Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Tue, 17 Sep 2024 17:30:28 +0200 Subject: [PATCH 5/7] fix(git-action): test merge main back to beta --- .github/workflows/main.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 952cf78..4bb8eed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -140,4 +140,29 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: coverage - # cname: + + merge-back-to-beta: + needs: semantic-version + strategy: + matrix: + os: [ubuntu-latest] + node: [20] + + runs-on: ${{ matrix.os }} + + steps: + - name: checkout repo + uses: actions/checkout@v4 + + - name: set git config + run: | + git config --local user.email "actions@github.com" + git config --local user.name "Github Actions" + + - name: merge main back to beta + run: | + git fetch --unshallow + git checkout dev + git pull + git merge --no-ff main -m "Auto-merge main back to beta" + git push From 2bbed5df01a96d577c9784a06776c42acdb8ea2f Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Tue, 17 Sep 2024 17:33:25 +0200 Subject: [PATCH 6/7] fix(git-action): merge main back to beta test --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4bb8eed..6836adc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -142,6 +142,7 @@ jobs: publish_dir: coverage merge-back-to-beta: + name: Update beta branch needs: semantic-version strategy: matrix: @@ -162,7 +163,7 @@ jobs: - name: merge main back to beta run: | git fetch --unshallow - git checkout dev + git checkout beta git pull git merge --no-ff main -m "Auto-merge main back to beta" git push From 47205f74c225d34aa79edecdd732fa56904c2ed1 Mon Sep 17 00:00:00 2001 From: StephanGerbeth Date: Tue, 17 Sep 2024 17:36:39 +0200 Subject: [PATCH 7/7] fix(test): test --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 59baf1e..b706ff0 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,12 @@ - [ ] finalize network retry - [ ] request paginator (full, lazy) - [ ] ... -- git actions + - git rules - [ ] main branch can be updated only by pull request from - [ ] beta branch