Skip to content

Commit 6713f4f

Browse files
committed
feat: migrate code from midway
0 parents  commit 6713f4f

33 files changed

+4606
-0
lines changed

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# 🎨 editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_style = space
9+
indent_size = 2
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true

.eslintrc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./node_modules/mwts/",
3+
"ignorePatterns": ["node_modules", "dist", "test", "jest.config.js", "interface.ts", "app.js", "agent.js"],
4+
"env": {
5+
"jest": true
6+
}
7+
}

.github/workflows/benchmark.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Node.js benchmark CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
node-version: [10.x, 12.x, 14.x, 16.x]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- run: npm install
21+
- run: npm run build --if-present
22+
- run: npm run cov
23+
24+
25+
build-windows:
26+
runs-on: windows-latest
27+
28+
strategy:
29+
matrix:
30+
node-version: [12.x, 14.x]
31+
32+
steps:
33+
- uses: actions/checkout@v2
34+
- name: Use Node.js ${{ matrix.node-version }}
35+
uses: actions/setup-node@v1
36+
with:
37+
node-version: ${{ matrix.node-version }}
38+
- run: npm install
39+
- run: npm run build --if-present
40+
- run: npm run cov

.github/workflows/nodejs.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Node.js CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
node-version: [12.x, 14.x, 16.x]
13+
14+
services:
15+
redis:
16+
image: redis
17+
options: >-
18+
--health-cmd "redis-cli ping"
19+
--health-interval 10s
20+
--health-timeout 5s
21+
--health-retries 5
22+
ports:
23+
- 6379:6379
24+
rabbitmq:
25+
image: rabbitmq:latest
26+
ports:
27+
- 5672/tcp
28+
options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s --health-timeout 5s --health-retries 5
29+
30+
steps:
31+
- name: Git checkout
32+
uses: actions/checkout@v2
33+
34+
- name: Use Node.js ${{ matrix.node-version }}
35+
uses: actions/setup-node@v1
36+
with:
37+
node-version: ${{ matrix.node-version }}
38+
39+
- name: Start MongoDB
40+
uses: supercharge/[email protected]
41+
with:
42+
mongodb-version: 4.2
43+
44+
- run: npm install && npm install codecov
45+
- run: npm run bootstrap
46+
- run: npm run build --if-present
47+
- run: npm run lint
48+
- run: npm run cov
49+
env:
50+
RABBITMQ_URL: amqp://localhost:${{ job.services.rabbitmq.ports[5672] }}
51+
ALI_SDK_OSS_REGION: ${{ secrets.ALI_SDK_OSS_REGION }}
52+
ALI_SDK_OSS_ENDPOINT: ${{ secrets.ALI_SDK_OSS_ENDPOINT }}
53+
ALI_SDK_OSS_ID: ${{ secrets.ALI_SDK_OSS_ID }}
54+
ALI_SDK_OSS_SECRET: ${{ secrets.ALI_SDK_OSS_SECRET }}
55+
ALI_SDK_OSS_BUCKET: ${{ secrets.ALI_SDK_OSS_BUCKET }}
56+
ALI_SDK_STS_ID: ${{ secrets.ALI_SDK_STS_ID }}
57+
ALI_SDK_STS_SECRET: ${{ secrets.ALI_SDK_STS_SECRET }}
58+
ALI_SDK_STS_BUCKET: ${{ secrets.ALI_SDK_STS_BUCKET }}
59+
ALI_SDK_STS_ROLE: ${{ secrets.ALI_SDK_STS_ROLE }}
60+
- name: Upload coverage to Codecov
61+
uses: codecov/codecov-action@v1
62+
63+
#
64+
# build-windows:
65+
# runs-on: windows-latest
66+
#
67+
# strategy:
68+
# matrix:
69+
# node-version: [12.x, 14.x]
70+
#
71+
# steps:
72+
# - uses: actions/checkout@v2
73+
# - name: Use Node.js ${{ matrix.node-version }}
74+
# uses: actions/setup-node@v1
75+
# with:
76+
# node-version: ${{ matrix.node-version }}
77+
# - run: npm install
78+
# - run: npm run bootstrap
79+
# - run: npm run build --if-present
80+
# - run: npm run cov

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.vscode
2+
node_modules
3+
*.log
4+
*.log.*
5+
logs
6+
.vscode
7+
dest
8+
dist
9+
coverage
10+
.idea
11+
package-lock.json
12+
.DS_*
13+
.nyc*
14+
!**/fixtures/app/node_modules/hello/*
15+
run/
16+
package-lock.json
17+
.nodejs-cache
18+
.tmp
19+
packages/midway/_package.json
20+
midway_benchmark_app
21+
*.sqlite
22+
.env

0 commit comments

Comments
 (0)