Skip to content

Commit 2e73518

Browse files
Merge pull request #41 from basics/feature/test
Feature/test
2 parents 2784b95 + 1e18e75 commit 2e73518

File tree

5 files changed

+167
-65
lines changed

5 files changed

+167
-65
lines changed

.github/workflows/beta.yml

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,33 @@ jobs:
2121
runs-on: ${{ matrix.os }}
2222

2323
steps:
24-
- uses: actions/checkout@v4
25-
- uses: actions/setup-node@v4
24+
- name: checkout repo
25+
uses: actions/checkout@v4
26+
27+
- name: setup node
28+
uses: actions/setup-node@v4
2629
with:
2730
node-version: ${{ matrix.node }}
28-
cache: 'npm'
29-
cache-dependency-path: 'package-lock.json'
3031

31-
- name: Install Dependencies
32+
- name: cache node_modules
33+
uses: actions/cache@v4
34+
id: cache
35+
with:
36+
path: |
37+
node_modules
38+
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
39+
40+
- name: install dependencies (no cache available)
41+
if: steps.cache.outputs.cache-hit != 'true'
3242
run: npm ci
3343

34-
- name: Lint
44+
- name: lint
3545
run: npm run lint
3646

37-
- name: Vitest - Test & Coverage
47+
- name: vitest - Test & Coverage
3848
run: npm run coverage
3949

40-
- name: Archive vitest code coverage results
50+
- name: archive vitest code coverage results
4151
uses: actions/upload-artifact@v4
4252
with:
4353
name: vitest-code-coverage-report
@@ -54,14 +64,26 @@ jobs:
5464
runs-on: ${{ matrix.os }}
5565

5666
steps:
57-
- uses: actions/checkout@v4
58-
- uses: actions/setup-node@v4
67+
- name: checkout repo
68+
uses: actions/checkout@v4
69+
70+
- name: setup node
71+
uses: actions/setup-node@v4
5972
with:
6073
node-version: ${{ matrix.node }}
61-
cache: 'npm'
62-
cache-dependency-path: 'package-lock.json'
63-
64-
- name: Versioning
74+
75+
- name: cache node_modules
76+
uses: actions/cache@v4
77+
id: cache
78+
with:
79+
path: node_modules
80+
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
81+
82+
- name: install dependencies (no cache available)
83+
if: steps.cache.outputs.cache-hit != 'true'
84+
run: npm ci
85+
86+
- name: release versioning
6587
env:
6688
GH_TOKEN: ${{ secrets.GH_TOKEN }}
6789
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -80,17 +102,18 @@ jobs:
80102
runs-on: ${{ matrix.os }}
81103

82104
steps:
83-
- uses: actions/checkout@v4
105+
- name: checkout repo
106+
uses: actions/checkout@v4
84107
with:
85108
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
86109

87-
- name: Download vitest code coverage results
110+
- name: download vitest code coverage results
88111
uses: actions/download-artifact@v4
89112
with:
90113
name: vitest-code-coverage-report
91114
path: ./coverage/
92115

93-
- name: SonarCloud Scan
116+
- name: SonarCloud scan
94117
uses: SonarSource/sonarcloud-github-action@master
95118
env:
96119
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any

.github/workflows/feature.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,33 @@ jobs:
2121
runs-on: ${{ matrix.os }}
2222

2323
steps:
24-
- uses: actions/checkout@v4
25-
- uses: actions/setup-node@v4
24+
- name: checkout repo
25+
uses: actions/checkout@v4
26+
27+
- name: setup node
28+
uses: actions/setup-node@v4
2629
with:
2730
node-version: ${{ matrix.node }}
28-
cache: 'npm'
29-
cache-dependency-path: '**/package-lock.json'
3031

31-
- name: Install Dependencies
32+
- name: cache node_modules
33+
uses: actions/cache@v4
34+
id: cache
35+
with:
36+
path: |
37+
node_modules
38+
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
39+
40+
- name: install dependencies (no cache available)
41+
if: steps.cache.outputs.cache-hit != 'true'
3242
run: npm ci
3343

34-
- name: Lint
44+
- name: lint
3545
run: npm run lint
3646

37-
- name: Vitest - Test & Coverage
47+
- name: vitest - test & coverage
3848
run: npm run coverage
3949

40-
- name: Archive vitest code coverage results
50+
- name: archive vitest code coverage results
4151
uses: actions/upload-artifact@v4
4252
with:
4353
name: vitest-code-coverage-report
@@ -54,17 +64,18 @@ jobs:
5464
runs-on: ${{ matrix.os }}
5565

5666
steps:
57-
- uses: actions/checkout@v4
67+
- name: checkout repo
68+
uses: actions/checkout@v4
5869
with:
5970
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
6071

61-
- name: Download vitest code coverage results
72+
- name: download vitest code coverage results
6273
uses: actions/download-artifact@v4
6374
with:
6475
name: vitest-code-coverage-report
6576
path: ./coverage/
6677

67-
- name: SonarCloud Scan
78+
- name: SonarCloud scan
6879
uses: SonarSource/sonarcloud-github-action@master
6980
env:
7081
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any

.github/workflows/main.yml

Lines changed: 72 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ jobs:
2121
runs-on: ${{ matrix.os }}
2222

2323
steps:
24-
- uses: actions/setup-node@v4
24+
- name: checkout repo
25+
uses: actions/checkout@v4
26+
27+
- name: setup node
28+
uses: actions/setup-node@v4
2529
with:
2630
node-version: ${{ matrix.node }}
2731

28-
- name: Checkout Repo
29-
uses: actions/checkout@v4
30-
3132
- name: cache node_modules
3233
uses: actions/cache@v4
3334
id: cache
@@ -36,17 +37,17 @@ jobs:
3637
node_modules
3738
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
3839

39-
- name: Install Dependencies
40+
- name: install dependencies (no cache available)
4041
if: steps.cache.outputs.cache-hit != 'true'
4142
run: npm ci
4243

43-
- name: Lint
44+
- name: lint
4445
run: npm run lint
4546

46-
- name: Vitest - Test & Coverage
47+
- name: vitest - Test & Coverage
4748
run: npm run coverage
4849

49-
- name: Archive vitest code coverage results
50+
- name: archive vitest code coverage results
5051
uses: actions/upload-artifact@v4
5152
with:
5253
name: vitest-code-coverage-report
@@ -63,21 +64,26 @@ jobs:
6364
runs-on: ${{ matrix.os }}
6465

6566
steps:
66-
- uses: actions/setup-node@v4
67+
- name: checkout repo
68+
uses: actions/checkout@v4
69+
70+
- name: setup node
71+
uses: actions/setup-node@v4
6772
with:
6873
node-version: ${{ matrix.node }}
6974

70-
- name: Checkout Repo
71-
uses: actions/checkout@v4
72-
7375
- name: cache node_modules
7476
uses: actions/cache@v4
7577
id: cache
7678
with:
7779
path: node_modules
7880
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
7981

80-
- name: Versioning
82+
- name: install dependencies (no cache available)
83+
if: steps.cache.outputs.cache-hit != 'true'
84+
run: npm ci
85+
86+
- name: release versioning
8187
env:
8288
GH_TOKEN: ${{ secrets.GH_TOKEN }}
8389
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -96,18 +102,68 @@ jobs:
96102
runs-on: ${{ matrix.os }}
97103

98104
steps:
99-
- uses: actions/checkout@v4
105+
- name: checkout repo
106+
uses: actions/checkout@v4
100107
with:
101108
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
102109

103-
- name: Download vitest code coverage results
110+
- name: download vitest code coverage results
104111
uses: actions/download-artifact@v4
105112
with:
106113
name: vitest-code-coverage-report
107114
path: ./coverage/
108115

109-
- name: SonarCloud Scan
116+
- name: SonarCloud scan
110117
uses: SonarSource/sonarcloud-github-action@master
111118
env:
112119
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
113120
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
121+
122+
deploy-ghpages:
123+
name: Deploy (GH-Pages)
124+
needs: semantic-version
125+
strategy:
126+
matrix:
127+
os: [ubuntu-latest]
128+
node: [20]
129+
130+
runs-on: ${{ matrix.os }}
131+
132+
steps:
133+
- name: download vitest code coverage results
134+
uses: actions/download-artifact@v4
135+
with:
136+
name: vitest-code-coverage-report
137+
path: ./coverage/
138+
- name: deploy to gh-pages
139+
uses: peaceiris/actions-gh-pages@v4
140+
with:
141+
github_token: ${{ secrets.GITHUB_TOKEN }}
142+
publish_dir: coverage
143+
144+
merge-back-to-beta:
145+
name: Update beta branch
146+
needs: semantic-version
147+
strategy:
148+
matrix:
149+
os: [ubuntu-latest]
150+
node: [20]
151+
152+
runs-on: ${{ matrix.os }}
153+
154+
steps:
155+
- name: checkout repo
156+
uses: actions/checkout@v4
157+
158+
- name: set git config
159+
run: |
160+
git config --local user.email "[email protected]"
161+
git config --local user.name "Github Actions"
162+
163+
- name: merge main back to beta
164+
run: |
165+
git fetch --unshallow
166+
git checkout beta
167+
git pull
168+
git merge --no-ff main -m "Auto-merge main back to beta"
169+
git push

README.md

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,43 @@
1010
[![Renovate - Status][renovate-status-src]][renovate-status-href]
1111
[![License][license-src]][license-href]
1212

13+
[![Coverage Report][vitest-coverage-src]][vitest-coverage-href]
14+
1315
---
1416

1517
## ToDo
1618
- evaluation
17-
- [ ] BranchNameLint alternative (https://www.npmjs.com/package/branch-name-lint)
18-
- [ ] SonarLint (https://docs.sonarsource.com/sonarcloud/improving/sonarlint/)
19-
- [ ] ...
19+
- [ ] BranchNameLint alternative (https://www.npmjs.com/package/branch-name-lint)
20+
- [ ] SonarLint (https://docs.sonarsource.com/sonarcloud/improving/sonarlint/)
21+
- [ ] ...
2022
- observables + test
21-
- [ ] default fetch
22-
- [ ] window dom (resize, scroll)?
23-
- [ ] ...
23+
- [ ] default fetch
24+
- [ ] window dom (resize, scroll)?
25+
- [ ] ...
2426
- operators + test
25-
- [ ] finalize network retry
26-
- [ ] request paginator (full, lazy)
27-
- [ ] ...
28-
- git actions
29-
- [ ] implemented merge strategy
30-
- only beta-branch can be merged into main
31-
- only feature-branches can be merged into beta
32-
- hotfixes can be merged directly into main, but beta will also be updated
33-
- [ ] ...
27+
- [ ] finalize network retry
28+
- [ ] request paginator (full, lazy)
29+
- [ ] ...
30+
<!-- - git actions
31+
- [ ] implemented merge strategy
32+
- only beta-branch can be merged into main
33+
- only feature-branches can be merged into beta
34+
- hotfixes can be merged directly into main, but beta will also be updated
35+
- [ ] ... -->
36+
- git rules
37+
- [ ] main branch can be updated only by pull request from
38+
- [ ] beta branch
39+
- [ ] hotfix branch
40+
- [ ] beta branch can be updated only by pull request from
41+
- [ ] feature branch
42+
- [ ] hotfix branch
3443
- sonarcloud
35-
- [ ] finalized config
36-
- [ ] ...
44+
- [ ] finalized config
45+
- [ ] ...
3746
- additional git action services
38-
- [ ] evaluate pr agent
39-
- [ ] ...
40-
- [ ] ...
47+
- [ ] evaluate pr agent
48+
- [ ] ...
49+
- [ ] ...
4150

4251

4352
[renovate-status-src]: <https://img.shields.io/badge/renovate-enabled-brightgreen>
@@ -59,3 +68,6 @@
5968

6069
[npm-downloads-src]: https://img.shields.io/npm/dt/nuxt-booster.svg?style=flat-square
6170
[npm-downloads-href]: https://npmjs.com/package/nuxt-booster
71+
72+
[vitest-coverage-src]: https://img.shields.io/badge/Coverage_Report-2ea44f?logo=vitest&logoColor=%23fff
73+
[vitest-coverage-href]: https://basics.github.io/rxjs-collection/

vitest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default defineConfig({
44
test: {
55
coverage: {
66
provider: 'v8',
7-
reporter: ['text', 'json', 'lcov'],
7+
reporter: ['text', 'json', 'lcov', 'html'],
88
reportsDirectory: './coverage',
99
exclude: [
1010
...configDefaults.exclude,

0 commit comments

Comments
 (0)