Skip to content

Commit 3aabacc

Browse files
Merge pull request #470 from splitio/development
Harness CI pipeline
2 parents 32f81c7 + 5558885 commit 3aabacc

File tree

7 files changed

+116
-98
lines changed

7 files changed

+116
-98
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/update-notice-year.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
pipeline:
2+
name: javascript-commons
3+
identifier: javascriptcommons
4+
projectIdentifier: Harness_Split
5+
orgIdentifier: PROD
6+
tags: {}
7+
properties:
8+
ci:
9+
codebase:
10+
connectorRef: fmegithubharnessgitops
11+
repoName: javascript-commons
12+
build: <+input>
13+
stages:
14+
- stage:
15+
name: Check-Test-Build
16+
identifier: Checkout_code
17+
description: ""
18+
type: CI
19+
spec:
20+
cloneCodebase: true
21+
caching:
22+
enabled: true
23+
override: true
24+
paths: []
25+
platform:
26+
os: Linux
27+
arch: Amd64
28+
runtime:
29+
type: Cloud
30+
spec:
31+
size: small
32+
imageSpec:
33+
imageName: ubuntu-latest
34+
buildIntelligence:
35+
enabled: false
36+
execution:
37+
steps:
38+
- step:
39+
type: Run
40+
name: Install and run redis-server
41+
identifier: redis_server
42+
spec:
43+
shell: Sh
44+
command: |-
45+
apt-get update && apt-get install -y redis-server
46+
redis-server --daemonize yes
47+
- step:
48+
type: Action
49+
name: Set up Node.js
50+
identifier: Set_up_Nodejs
51+
spec:
52+
uses: dcodeIO/setup-node-nvm@master
53+
with:
54+
node-version: lts/*
55+
- step:
56+
type: Run
57+
name: npm ci
58+
identifier: npm_ci
59+
spec:
60+
shell: Sh
61+
command: npm ci
62+
- step:
63+
type: Run
64+
name: npm run check
65+
identifier: npm_run_check
66+
spec:
67+
shell: Sh
68+
command: npm run check
69+
- step:
70+
type: Run
71+
name: npm run test
72+
identifier: npm_run_test
73+
spec:
74+
shell: Sh
75+
command: npm run test
76+
- step:
77+
type: Run
78+
name: npm run build
79+
identifier: npm_run_build
80+
spec:
81+
shell: Sh
82+
command: npm run build
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
inputSet:
2+
name: javascript-commons
3+
tags: {}
4+
identifier: javascriptcommons
5+
orgIdentifier: PROD
6+
projectIdentifier: Harness_Split
7+
pipeline:
8+
identifier: javascriptcommons
9+
properties:
10+
ci:
11+
codebase:
12+
build:
13+
type: branch
14+
spec:
15+
branch: <+trigger.branch>

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22
1+
lts/*

package-lock.json

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/__tests__/testUtils/csv.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
import fs from 'fs';
2-
import rl from 'readline';
32

43
export function readCSV(filePath: string, delimiter = ','): Promise<string[][]> {
5-
return new Promise((resolve) => {
6-
const parser = rl.createInterface({
7-
input: fs.createReadStream(filePath)
8-
});
4+
return new Promise((resolve, reject) => {
5+
fs.readFile(filePath, 'utf8', (err, content) => {
6+
if (err) return reject(err);
97

10-
const data: string[][] = [];
8+
const lines = content.split(/\r?\n/);
9+
const data = lines
10+
.filter(line => line.trim().length > 0)
11+
.map(line => line.split(delimiter));
1112

12-
parser
13-
.on('line', line => {
14-
data.push(line.split(delimiter));
15-
})
16-
.on('close', () => resolve(data));
13+
resolve(data);
14+
});
1715
});
1816
}

0 commit comments

Comments
 (0)