File tree Expand file tree Collapse file tree 4 files changed +71
-9
lines changed Expand file tree Collapse file tree 4 files changed +71
-9
lines changed Original file line number Diff line number Diff line change
1
+ name : Node.js CI Coverage
2
+
3
+ on :
4
+ push :
5
+ branches : [ "main", "develop", "feature/*" ]
6
+ pull_request :
7
+ branches : [ "main" ]
8
+
9
+ jobs :
10
+ build :
11
+
12
+ runs-on : ubuntu-latest
13
+
14
+ strategy :
15
+ matrix :
16
+ os : [
17
+ " ubuntu-latest"
18
+ ]
19
+ node-version : [20.x]
20
+ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21
+
22
+ steps :
23
+ - name : Checkout repository
24
+ uses : actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4
25
+
26
+ - name : Set up Node.js ${{ matrix.node-version }}
27
+ uses : actions/setup-node@v4
28
+ with :
29
+ node-version : ${{ matrix.node-version }}
30
+
31
+ - name : Install dependencies
32
+ run : npm ci --verbose
33
+
34
+ - name : Lint
35
+ run : npm run lint
36
+
37
+ - name : Run the tests
38
+ run : npm test -- --coverage
39
+
40
+ - name : Upload coverage reports to Codecov with GitHub Action
41
+ uses : codecov/codecov-action@v4
42
+ with :
43
+ token : ${{ secrets.CODECOV_TOKEN }} # required
44
+ verbose : true # optional (default = false)
45
+
46
+ - name : SonarCloud Scan
47
+ uses : SonarSource/sonarcloud-github-action@master
48
+ env :
49
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
50
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change 1
- name : Node.js CI
1
+ name : Node.js CI Tests
2
2
3
3
on :
4
4
push :
37
37
run : npm run lint
38
38
39
39
- name : Run the tests
40
- run : npm test -- --coverage
41
-
42
- - name : Upload coverage reports to Codecov with GitHub Action
43
- uses : codecov/codecov-action@v4
44
- with :
45
- token : ${{ secrets.CODECOV_TOKEN }} # required
46
- verbose : true # optional (default = false)
40
+ run : npm test
Original file line number Diff line number Diff line change
1
+ sonar.projectKey =sir-gon_algorithm-exercises-ts
2
+ sonar.organization =sir-gon
3
+
4
+ # This is the name and version displayed in the SonarCloud UI.
5
+ # sonar.projectName=algorithm-exercises-ts
6
+ # sonar.projectVersion=1.0
7
+
8
+
9
+ # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
10
+ sonar.sources =src
11
+ sonar.exclusions =**/*.json
12
+
13
+ # Encoding of the source code. Default is default system encoding
14
+ sonar.sourceEncoding =UTF-8
15
+
16
+ # Coverage
17
+ sonar.javascript.lcov.reportPaths =./coverage/lcov.info
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ export function problem0018(_triangle: number[][]): number {
31
31
console . debug ( `leafs count: ${ leafs . length } ` ) ;
32
32
console . debug ( `leafs: ${ leafs } ` ) ;
33
33
34
- const max = leafs . reduce ( ( a , b ) => ( a > b ? a : b ) ) ;
34
+ const __START_FROM__ = 0 ;
35
+ const max = leafs . reduce ( ( a , b ) => ( a > b ? a : b ) , __START_FROM__ ) ;
35
36
36
37
return max ;
37
38
}
You can’t perform that action at this time.
0 commit comments