pulsar-client 1.13.2 → 1.14.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/aws.xml +18 -0
- package/.idea/codeStyles/Project.xml +7 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/misc.xml +7 -0
- package/.idea/modules.xml +9 -0
- package/.idea/pulsar-client-node.iml +46 -0
- package/.idea/pulsar_client_node.iml +8 -0
- package/.idea/vcs.xml +6 -0
- package/index.d.ts +17 -0
- package/package.json +1 -1
- package/src/Client.cc +2 -1
- package/src/Client.h +1 -0
- package/src/ConsumerConfig.cc +66 -0
- package/src/cert.pem +3278 -0
- package/.clang-format +0 -26
- package/.eslintignore +0 -21
- package/.eslintrc.json +0 -22
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -85
- package/.github/workflows/ci-build-release-napi.yml +0 -211
- package/.github/workflows/ci-pr-validation.yml +0 -334
- package/build-support/download-release-artifacts.py +0 -77
- package/build-support/generate-source-archive.sh +0 -28
- package/build-support/pulsar-test-container-start.sh +0 -43
- package/build-support/pulsar-test-service-start.sh +0 -39
- package/build-support/pulsar-test-service-stop.sh +0 -32
- package/build-support/sign-files.sh +0 -32
- package/build-support/stage-release.sh +0 -44
- package/docs/release-process.md +0 -291
- package/examples/certificate/private-key.client-rsa.pem +0 -27
- package/examples/certificate/public-key.client-rsa.pem +0 -9
- package/examples/consumer-schema.js +0 -66
- package/examples/consumer.js +0 -46
- package/examples/consumer_listener.js +0 -44
- package/examples/consumer_tls_auth.js +0 -51
- package/examples/consummer_token_auth.js +0 -50
- package/examples/consummer_token_auth_supplier.js +0 -56
- package/examples/custom_logger.js +0 -60
- package/examples/encryption-consumer.js +0 -47
- package/examples/encryption-producer.js +0 -50
- package/examples/encryption-reader.js +0 -44
- package/examples/producer-schema.js +0 -76
- package/examples/producer.js +0 -48
- package/examples/producer_tls_auth.js +0 -52
- package/examples/producer_token_auth.js +0 -48
- package/examples/producer_token_auth_supplier.js +0 -53
- package/examples/reader.js +0 -43
- package/examples/reader_listener.js +0 -37
- package/license-checker-config.json +0 -43
- package/license-header.txt +0 -16
- package/perf/perf_consumer.js +0 -103
- package/perf/perf_producer.js +0 -118
- package/pkg/linux/Dockerfile_linux_glibc +0 -31
- package/pkg/linux/Dockerfile_linux_musl +0 -32
- package/pkg/linux/build-napi-inside-docker.sh +0 -31
- package/pkg/linux/download-cpp-client.sh +0 -65
- package/pkg/load_test.js +0 -34
- package/pkg/mac/download-cpp-client.sh +0 -36
- package/pkg/windows/download-cpp-client.bat +0 -12
- package/tests/certificate/private-key.client-rsa.pem +0 -27
- package/tests/certificate/public-key.client-rsa.pem +0 -9
- package/tests/certificate/server.crt +0 -20
- package/tests/certificate/server.key +0 -28
- package/tests/client.test.js +0 -122
- package/tests/conf/standalone.conf +0 -308
- package/tests/consumer.test.js +0 -434
- package/tests/docker-load-test.sh +0 -35
- package/tests/end_to_end.test.js +0 -1447
- package/tests/http_utils.js +0 -45
- package/tests/load-test.sh +0 -43
- package/tests/producer.test.js +0 -160
- package/tests/reader.test.js +0 -175
- package/tests/run-unit-tests.sh +0 -35
- package/tsconfig.json +0 -22
- package/tslint.json +0 -9
- package/tstest.ts +0 -408
- package/typedoc.json +0 -15
package/.clang-format
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
# or more contributor license agreements. See the NOTICE file
|
|
4
|
-
# distributed with this work for additional information
|
|
5
|
-
# regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
# to you under the Apache License, Version 2.0 (the
|
|
7
|
-
# "License"); you may not use this file except in compliance
|
|
8
|
-
# with the License. You may obtain a copy of the License at
|
|
9
|
-
#
|
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
#
|
|
12
|
-
# Unless required by applicable law or agreed to in writing,
|
|
13
|
-
# software distributed under the License is distributed on an
|
|
14
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
# KIND, either express or implied. See the License for the
|
|
16
|
-
# specific language governing permissions and limitations
|
|
17
|
-
# under the License.
|
|
18
|
-
#
|
|
19
|
-
|
|
20
|
-
BasedOnStyle: Google
|
|
21
|
-
IndentWidth: 2
|
|
22
|
-
ColumnLimit: 110
|
|
23
|
-
SortIncludes: false
|
|
24
|
-
BreakBeforeBraces: Custom
|
|
25
|
-
BraceWrapping:
|
|
26
|
-
AfterEnum: true
|
package/.eslintignore
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
# or more contributor license agreements. See the NOTICE file
|
|
4
|
-
# distributed with this work for additional information
|
|
5
|
-
# regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
# to you under the Apache License, Version 2.0 (the
|
|
7
|
-
# "License"); you may not use this file except in compliance
|
|
8
|
-
# with the License. You may obtain a copy of the License at
|
|
9
|
-
#
|
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
#
|
|
12
|
-
# Unless required by applicable law or agreed to in writing,
|
|
13
|
-
# software distributed under the License is distributed on an
|
|
14
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
# KIND, either express or implied. See the License for the
|
|
16
|
-
# specific language governing permissions and limitations
|
|
17
|
-
# under the License.
|
|
18
|
-
#
|
|
19
|
-
|
|
20
|
-
examples
|
|
21
|
-
perf
|
package/.eslintrc.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["airbnb-base","plugin:jest/recommended"],
|
|
3
|
-
"rules": {
|
|
4
|
-
"class-methods-use-this": "warn",
|
|
5
|
-
"no-await-in-loop": "warn",
|
|
6
|
-
"no-console": "off",
|
|
7
|
-
"no-unused-vars": "warn"
|
|
8
|
-
},
|
|
9
|
-
"overrides": [
|
|
10
|
-
{
|
|
11
|
-
"files": ["tests/*.js"],
|
|
12
|
-
"rules": {
|
|
13
|
-
"no-await-in-loop": "off"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"globals": {
|
|
18
|
-
"describe": true,
|
|
19
|
-
"test": true,
|
|
20
|
-
"expect": true
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
|
|
3
|
-
Licensed to the Apache Software Foundation (ASF) under one
|
|
4
|
-
or more contributor license agreements. See the NOTICE file
|
|
5
|
-
distributed with this work for additional information
|
|
6
|
-
regarding copyright ownership. The ASF licenses this file
|
|
7
|
-
to you under the Apache License, Version 2.0 (the
|
|
8
|
-
"License"); you may not use this file except in compliance
|
|
9
|
-
with the License. You may obtain a copy of the License at
|
|
10
|
-
|
|
11
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
|
|
13
|
-
Unless required by applicable law or agreed to in writing,
|
|
14
|
-
software distributed under the License is distributed on an
|
|
15
|
-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
KIND, either express or implied. See the License for the
|
|
17
|
-
specific language governing permissions and limitations
|
|
18
|
-
under the License.
|
|
19
|
-
|
|
20
|
-
-->
|
|
21
|
-
<!--
|
|
22
|
-
### Contribution Checklist
|
|
23
|
-
|
|
24
|
-
- PR title format should be *[type][component] summary*. For details, see *[Guideline - Pulsar PR Naming Convention](https://docs.google.com/document/d/1d8Pw6ZbWk-_pCKdOmdvx9rnhPiyuxwq60_TrD68d7BA/edit#heading=h.trs9rsex3xom)*.
|
|
25
|
-
|
|
26
|
-
- Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
|
|
27
|
-
|
|
28
|
-
- Each pull request should address only one issue, not mix up code from multiple issues.
|
|
29
|
-
|
|
30
|
-
- Each commit in the pull request has a meaningful commit message
|
|
31
|
-
|
|
32
|
-
- Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
|
|
33
|
-
-->
|
|
34
|
-
|
|
35
|
-
<!-- Either this PR fixes an issue, -->
|
|
36
|
-
|
|
37
|
-
Fixes #<xyz>
|
|
38
|
-
|
|
39
|
-
<!-- or this PR is one task of an issue -->
|
|
40
|
-
|
|
41
|
-
Master Issue: #<xyz>
|
|
42
|
-
|
|
43
|
-
### Motivation
|
|
44
|
-
|
|
45
|
-
<!-- Explain here the context, and why you're making that change. What is the problem you're trying to solve. -->
|
|
46
|
-
|
|
47
|
-
### Modifications
|
|
48
|
-
|
|
49
|
-
<!-- Describe the modifications you've done. -->
|
|
50
|
-
|
|
51
|
-
### Verifying this change
|
|
52
|
-
|
|
53
|
-
- [ ] Make sure that the change passes the CI checks.
|
|
54
|
-
|
|
55
|
-
*(Please pick either of the following options)*
|
|
56
|
-
|
|
57
|
-
This change is a trivial rework / code cleanup without any test coverage.
|
|
58
|
-
|
|
59
|
-
*(or)*
|
|
60
|
-
|
|
61
|
-
This change is already covered by existing tests, such as *(please describe tests)*.
|
|
62
|
-
|
|
63
|
-
*(or)*
|
|
64
|
-
|
|
65
|
-
This change added tests and can be verified as follows:
|
|
66
|
-
|
|
67
|
-
*(example:)*
|
|
68
|
-
- *Added integration tests for end-to-end deployment with large payloads (10MB)*
|
|
69
|
-
- *Extended integration test for recovery after broker failure*
|
|
70
|
-
|
|
71
|
-
### Documentation
|
|
72
|
-
|
|
73
|
-
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
|
|
74
|
-
|
|
75
|
-
- [ ] `doc-required`
|
|
76
|
-
(Your PR needs to update docs and you will update later)
|
|
77
|
-
|
|
78
|
-
- [ ] `doc-not-needed`
|
|
79
|
-
(Please explain why)
|
|
80
|
-
|
|
81
|
-
- [ ] `doc`
|
|
82
|
-
(Your PR contains doc changes)
|
|
83
|
-
|
|
84
|
-
- [ ] `doc-complete`
|
|
85
|
-
(Docs have been already added)
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
# or more contributor license agreements. See the NOTICE file
|
|
4
|
-
# distributed with this work for additional information
|
|
5
|
-
# regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
# to you under the Apache License, Version 2.0 (the
|
|
7
|
-
# "License"); you may not use this file except in compliance
|
|
8
|
-
# with the License. You may obtain a copy of the License at
|
|
9
|
-
#
|
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
#
|
|
12
|
-
# Unless required by applicable law or agreed to in writing,
|
|
13
|
-
# software distributed under the License is distributed on an
|
|
14
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
# KIND, either express or implied. See the License for the
|
|
16
|
-
# specific language governing permissions and limitations
|
|
17
|
-
# under the License.
|
|
18
|
-
#
|
|
19
|
-
name: Build release napi
|
|
20
|
-
on:
|
|
21
|
-
workflow_dispatch:
|
|
22
|
-
push:
|
|
23
|
-
tags:
|
|
24
|
-
- '*'
|
|
25
|
-
env:
|
|
26
|
-
FORCE_COLOR: 1
|
|
27
|
-
concurrency:
|
|
28
|
-
group: ${{ github.head_ref || github.run_id }}
|
|
29
|
-
cancel-in-progress: true
|
|
30
|
-
jobs:
|
|
31
|
-
macos-napi:
|
|
32
|
-
name: Build NAPI macos - Node ${{matrix.nodejs}} - ${{matrix.arch}}
|
|
33
|
-
runs-on: ${{ matrix.os }}
|
|
34
|
-
timeout-minutes: 3000
|
|
35
|
-
|
|
36
|
-
strategy:
|
|
37
|
-
fail-fast: false
|
|
38
|
-
matrix:
|
|
39
|
-
arch:
|
|
40
|
-
- x64
|
|
41
|
-
- arm64
|
|
42
|
-
nodejs:
|
|
43
|
-
- 18
|
|
44
|
-
python:
|
|
45
|
-
- "3.10"
|
|
46
|
-
include:
|
|
47
|
-
- arch: x64
|
|
48
|
-
os: macos-13
|
|
49
|
-
- arch: arm64
|
|
50
|
-
# macos-14 is used for arm64
|
|
51
|
-
os: macos-14
|
|
52
|
-
steps:
|
|
53
|
-
- uses: actions/checkout@v3
|
|
54
|
-
- name: Use Node.js ${{ matrix.nodejs }}
|
|
55
|
-
uses: actions/setup-node@v3
|
|
56
|
-
with:
|
|
57
|
-
node-version: ${{ matrix.nodejs }}
|
|
58
|
-
cache: 'npm'
|
|
59
|
-
|
|
60
|
-
- name: Use Python ${{ matrix.python }}
|
|
61
|
-
uses: actions/setup-python@v3
|
|
62
|
-
with:
|
|
63
|
-
python-version: ${{ matrix.python }}
|
|
64
|
-
|
|
65
|
-
- name: Build Node binaries lib
|
|
66
|
-
run: |
|
|
67
|
-
if [ "${{ matrix.arch }}" = "x64" ]; then
|
|
68
|
-
export ARCH=x86_64
|
|
69
|
-
else
|
|
70
|
-
export ARCH=${{ matrix.arch }}
|
|
71
|
-
fi
|
|
72
|
-
pkg/mac/download-cpp-client.sh
|
|
73
|
-
npm install --ignore-scripts
|
|
74
|
-
npx node-pre-gyp configure --target_arch=${{ matrix.arch }}
|
|
75
|
-
npx node-pre-gyp build --target_arch=${{ matrix.arch }}
|
|
76
|
-
|
|
77
|
-
- name: Test loading Node binaries lib
|
|
78
|
-
run: |
|
|
79
|
-
node pkg/load_test.js
|
|
80
|
-
|
|
81
|
-
- name: Package Node binaries lib
|
|
82
|
-
run: |
|
|
83
|
-
npx node-pre-gyp package --target_arch=${{ matrix.arch }}
|
|
84
|
-
|
|
85
|
-
- name: Upload artifacts
|
|
86
|
-
uses: actions/upload-artifact@v4
|
|
87
|
-
with:
|
|
88
|
-
name: macos-${{matrix.nodejs}}-${{matrix.arch}}
|
|
89
|
-
path: build/stage/*/*.tar.gz
|
|
90
|
-
|
|
91
|
-
linux-napi:
|
|
92
|
-
name: Build NAPI ${{matrix.image}} - Node ${{matrix.nodejs}} - ${{matrix.cpu.platform}}
|
|
93
|
-
runs-on: ubuntu-22.04
|
|
94
|
-
timeout-minutes: 3000
|
|
95
|
-
|
|
96
|
-
strategy:
|
|
97
|
-
fail-fast: false
|
|
98
|
-
matrix:
|
|
99
|
-
image:
|
|
100
|
-
- 'linux_glibc'
|
|
101
|
-
- 'linux_musl'
|
|
102
|
-
nodejs:
|
|
103
|
-
- 18
|
|
104
|
-
cpu:
|
|
105
|
-
- {arch: 'x86_64', platform: 'x86_64'}
|
|
106
|
-
- {arch: 'aarch64', platform: 'arm64'}
|
|
107
|
-
|
|
108
|
-
steps:
|
|
109
|
-
- name: checkout
|
|
110
|
-
uses: actions/checkout@v3
|
|
111
|
-
|
|
112
|
-
- name: Set up QEMU
|
|
113
|
-
uses: docker/setup-qemu-action@v2
|
|
114
|
-
|
|
115
|
-
- name: Setup Docker Buildx
|
|
116
|
-
uses: docker/setup-buildx-action@v2
|
|
117
|
-
|
|
118
|
-
- name: Build Linux Docker image
|
|
119
|
-
uses: docker/build-push-action@v3
|
|
120
|
-
with:
|
|
121
|
-
file: ./pkg/linux/Dockerfile_${{matrix.image}}
|
|
122
|
-
load: true
|
|
123
|
-
tags: build:latest
|
|
124
|
-
platforms: linux/${{matrix.cpu.arch}}
|
|
125
|
-
build-args: |
|
|
126
|
-
PLATFORM=${{matrix.cpu.platform}}
|
|
127
|
-
ARCH=${{matrix.cpu.arch}}
|
|
128
|
-
NODE_VERSION=${{matrix.nodejs}}
|
|
129
|
-
cache-from: type=gha
|
|
130
|
-
cache-to: type=gha,mode=max
|
|
131
|
-
|
|
132
|
-
- name: Build and Test NAPI file
|
|
133
|
-
run: |
|
|
134
|
-
docker run -i -v $PWD:/pulsar-client-node build:latest \
|
|
135
|
-
/pulsar-client-node/pkg/linux/build-napi-inside-docker.sh
|
|
136
|
-
|
|
137
|
-
- name: Upload artifacts
|
|
138
|
-
uses: actions/upload-artifact@v4
|
|
139
|
-
with:
|
|
140
|
-
name: ${{matrix.image}}-${{matrix.nodejs}}-${{matrix.cpu.platform}}
|
|
141
|
-
path: build/stage/*/*.tar.gz
|
|
142
|
-
|
|
143
|
-
windows-napi:
|
|
144
|
-
name: Build NAPI windows - Node ${{matrix.nodejs}} - ${{matrix.arch}}
|
|
145
|
-
runs-on: windows-2022
|
|
146
|
-
timeout-minutes: 3000
|
|
147
|
-
|
|
148
|
-
strategy:
|
|
149
|
-
fail-fast: false
|
|
150
|
-
matrix:
|
|
151
|
-
arch:
|
|
152
|
-
- x64
|
|
153
|
-
- x86
|
|
154
|
-
nodejs:
|
|
155
|
-
- 18
|
|
156
|
-
python:
|
|
157
|
-
- "3.10"
|
|
158
|
-
steps:
|
|
159
|
-
- uses: actions/checkout@v3
|
|
160
|
-
- name: Use Node.js ${{ matrix.nodejs }}
|
|
161
|
-
uses: actions/setup-node@v3
|
|
162
|
-
with:
|
|
163
|
-
node-version: ${{ matrix.nodejs }}
|
|
164
|
-
architecture: ${{ matrix.arch }}
|
|
165
|
-
cache: 'npm'
|
|
166
|
-
|
|
167
|
-
- name: Use Python ${{ matrix.python }}
|
|
168
|
-
uses: actions/setup-python@v3
|
|
169
|
-
with:
|
|
170
|
-
python-version: ${{ matrix.python }}
|
|
171
|
-
|
|
172
|
-
- name: Cache CPP Client
|
|
173
|
-
id: cache-dependencies
|
|
174
|
-
uses: actions/cache@v3
|
|
175
|
-
with:
|
|
176
|
-
path: pkg/windows/
|
|
177
|
-
key: ${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('pulsar-client-cpp.txt') }}
|
|
178
|
-
|
|
179
|
-
- name: Add env vars
|
|
180
|
-
shell: bash
|
|
181
|
-
run: |
|
|
182
|
-
if [ "${{ matrix.arch }}" = "x86" ]; then
|
|
183
|
-
echo "TARGET=ia32" >> $GITHUB_ENV
|
|
184
|
-
else
|
|
185
|
-
echo "TARGET=${{ matrix.arch }}" >> $GITHUB_ENV
|
|
186
|
-
fi
|
|
187
|
-
|
|
188
|
-
- name: Download CPP Client
|
|
189
|
-
if: steps.cache-dependencies.outputs.cache-hit != 'true'
|
|
190
|
-
run: |
|
|
191
|
-
pkg/windows/download-cpp-client.bat ${{ matrix.arch }}
|
|
192
|
-
|
|
193
|
-
- name: Build Node binaries lib
|
|
194
|
-
run: |
|
|
195
|
-
npm install --ignore-scripts
|
|
196
|
-
npx node-pre-gyp configure --target_arch=${{ env.TARGET }}
|
|
197
|
-
npx node-pre-gyp build --target_arch=${{ env.TARGET }}
|
|
198
|
-
|
|
199
|
-
- name: Test loading Node binaries lib
|
|
200
|
-
run: |
|
|
201
|
-
node pkg/load_test.js
|
|
202
|
-
|
|
203
|
-
- name: Package Node binaries lib
|
|
204
|
-
run: |
|
|
205
|
-
npx node-pre-gyp package --target_arch=${{ env.TARGET }}
|
|
206
|
-
|
|
207
|
-
- name: Upload artifacts
|
|
208
|
-
uses: actions/upload-artifact@v4
|
|
209
|
-
with:
|
|
210
|
-
name: windows-${{matrix.nodejs}}-${{matrix.arch}}
|
|
211
|
-
path: build/stage/*/*.tar.gz
|
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
# or more contributor license agreements. See the NOTICE file
|
|
4
|
-
# distributed with this work for additional information
|
|
5
|
-
# regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
# to you under the Apache License, Version 2.0 (the
|
|
7
|
-
# "License"); you may not use this file except in compliance
|
|
8
|
-
# with the License. You may obtain a copy of the License at
|
|
9
|
-
#
|
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
#
|
|
12
|
-
# Unless required by applicable law or agreed to in writing,
|
|
13
|
-
# software distributed under the License is distributed on an
|
|
14
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
# KIND, either express or implied. See the License for the
|
|
16
|
-
# specific language governing permissions and limitations
|
|
17
|
-
# under the License.
|
|
18
|
-
#
|
|
19
|
-
name: PR validation
|
|
20
|
-
on:
|
|
21
|
-
pull_request:
|
|
22
|
-
branches: ['master']
|
|
23
|
-
|
|
24
|
-
concurrency:
|
|
25
|
-
group: ${{ github.workflow }}-${{ github.ref }}
|
|
26
|
-
cancel-in-progress: true
|
|
27
|
-
|
|
28
|
-
jobs:
|
|
29
|
-
unit-tests:
|
|
30
|
-
name: Run unit tests
|
|
31
|
-
runs-on: ubuntu-22.04
|
|
32
|
-
timeout-minutes: 120
|
|
33
|
-
strategy:
|
|
34
|
-
matrix:
|
|
35
|
-
python:
|
|
36
|
-
- "3.10"
|
|
37
|
-
|
|
38
|
-
steps:
|
|
39
|
-
- uses: actions/checkout@v3
|
|
40
|
-
- name: Use Node.js 18
|
|
41
|
-
uses: actions/setup-node@v3
|
|
42
|
-
with:
|
|
43
|
-
node-version: 18
|
|
44
|
-
|
|
45
|
-
- name: Use Python ${{ matrix.python }}
|
|
46
|
-
uses: actions/setup-python@v3
|
|
47
|
-
with:
|
|
48
|
-
python-version: ${{ matrix.python }}
|
|
49
|
-
|
|
50
|
-
- name: Run Test
|
|
51
|
-
run: |
|
|
52
|
-
./tests/run-unit-tests.sh
|
|
53
|
-
- name: Check license headers
|
|
54
|
-
run: |
|
|
55
|
-
npm run license:checkheader
|
|
56
|
-
|
|
57
|
-
validation-yarn:
|
|
58
|
-
name: Validation use yarn install
|
|
59
|
-
runs-on: ubuntu-22.04
|
|
60
|
-
timeout-minutes: 120
|
|
61
|
-
|
|
62
|
-
steps:
|
|
63
|
-
- uses: actions/checkout@v3
|
|
64
|
-
- name: Use Node.js 18
|
|
65
|
-
uses: actions/setup-node@v3
|
|
66
|
-
with:
|
|
67
|
-
node-version: 18
|
|
68
|
-
|
|
69
|
-
- name: Use yarn install
|
|
70
|
-
run: |
|
|
71
|
-
yarn install --ignore-scripts
|
|
72
|
-
|
|
73
|
-
macos-napi:
|
|
74
|
-
name: Build NAPI macos - Node ${{matrix.nodejs}} - ${{matrix.arch}}
|
|
75
|
-
runs-on: ${{ matrix.os }}
|
|
76
|
-
timeout-minutes: 3000
|
|
77
|
-
|
|
78
|
-
strategy:
|
|
79
|
-
fail-fast: false
|
|
80
|
-
matrix:
|
|
81
|
-
arch:
|
|
82
|
-
- x64
|
|
83
|
-
- arm64
|
|
84
|
-
nodejs:
|
|
85
|
-
- 18
|
|
86
|
-
python:
|
|
87
|
-
- "3.10"
|
|
88
|
-
include:
|
|
89
|
-
- arch: x64
|
|
90
|
-
os: macos-13
|
|
91
|
-
- arch: arm64
|
|
92
|
-
# macos-14 is used for arm64
|
|
93
|
-
os: macos-14
|
|
94
|
-
steps:
|
|
95
|
-
- uses: actions/checkout@v3
|
|
96
|
-
- name: Use Node.js ${{ matrix.nodejs }}
|
|
97
|
-
uses: actions/setup-node@v3
|
|
98
|
-
with:
|
|
99
|
-
node-version: ${{ matrix.nodejs }}
|
|
100
|
-
cache: 'npm'
|
|
101
|
-
|
|
102
|
-
- name: Use Python ${{ matrix.python }}
|
|
103
|
-
uses: actions/setup-python@v3
|
|
104
|
-
with:
|
|
105
|
-
python-version: ${{ matrix.python }}
|
|
106
|
-
|
|
107
|
-
- name: Build Node binaries lib
|
|
108
|
-
run: |
|
|
109
|
-
if [ "${{ matrix.arch }}" = "x64" ]; then
|
|
110
|
-
export ARCH=x86_64
|
|
111
|
-
else
|
|
112
|
-
export ARCH=${{ matrix.arch }}
|
|
113
|
-
fi
|
|
114
|
-
pkg/mac/download-cpp-client.sh
|
|
115
|
-
npm install --ignore-scripts
|
|
116
|
-
npx node-pre-gyp configure --target_arch=${{ matrix.arch }}
|
|
117
|
-
npx node-pre-gyp build --target_arch=${{ matrix.arch }}
|
|
118
|
-
|
|
119
|
-
- name: Test loading Node binaries lib
|
|
120
|
-
run: |
|
|
121
|
-
node pkg/load_test.js
|
|
122
|
-
|
|
123
|
-
- name: Package Node binaries lib
|
|
124
|
-
run: |
|
|
125
|
-
npx node-pre-gyp package --target_arch=${{ matrix.arch }}
|
|
126
|
-
|
|
127
|
-
linux-napi:
|
|
128
|
-
name: Build NAPI ${{matrix.image}} - Node ${{matrix.nodejs}} - ${{matrix.cpu.platform}}
|
|
129
|
-
runs-on: ubuntu-22.04
|
|
130
|
-
timeout-minutes: 3000
|
|
131
|
-
|
|
132
|
-
strategy:
|
|
133
|
-
fail-fast: false
|
|
134
|
-
matrix:
|
|
135
|
-
image:
|
|
136
|
-
- 'linux_glibc'
|
|
137
|
-
- 'linux_musl'
|
|
138
|
-
nodejs:
|
|
139
|
-
- 18
|
|
140
|
-
cpu:
|
|
141
|
-
- {arch: 'x86_64', platform: 'x86_64'}
|
|
142
|
-
- {arch: 'aarch64', platform: 'arm64'}
|
|
143
|
-
|
|
144
|
-
steps:
|
|
145
|
-
- name: checkout
|
|
146
|
-
uses: actions/checkout@v3
|
|
147
|
-
|
|
148
|
-
- name: Set up QEMU
|
|
149
|
-
uses: docker/setup-qemu-action@v2
|
|
150
|
-
|
|
151
|
-
- name: Setup Docker Buildx
|
|
152
|
-
uses: docker/setup-buildx-action@v2
|
|
153
|
-
|
|
154
|
-
- name: Build Linux Docker image
|
|
155
|
-
uses: docker/build-push-action@v3
|
|
156
|
-
with:
|
|
157
|
-
file: ./pkg/linux/Dockerfile_${{matrix.image}}
|
|
158
|
-
load: true
|
|
159
|
-
tags: build:latest
|
|
160
|
-
platforms: linux/${{matrix.cpu.arch}}
|
|
161
|
-
build-args: |
|
|
162
|
-
PLATFORM=${{matrix.cpu.platform}}
|
|
163
|
-
ARCH=${{matrix.cpu.arch}}
|
|
164
|
-
NODE_VERSION=${{matrix.nodejs}}
|
|
165
|
-
cache-from: type=gha
|
|
166
|
-
cache-to: type=gha,mode=max
|
|
167
|
-
|
|
168
|
-
- name: Build and Test NAPI file
|
|
169
|
-
run: |
|
|
170
|
-
docker run -i -v $PWD:/pulsar-client-node build:latest \
|
|
171
|
-
/pulsar-client-node/pkg/linux/build-napi-inside-docker.sh
|
|
172
|
-
|
|
173
|
-
- name: Test NAPI file in linux_glibc containers
|
|
174
|
-
if: matrix.image == 'linux_glibc'
|
|
175
|
-
run: |
|
|
176
|
-
./tests/load-test.sh node:16-buster ${{matrix.cpu.platform}}
|
|
177
|
-
./tests/load-test.sh node:16-bullseye ${{matrix.cpu.platform}}
|
|
178
|
-
./tests/load-test.sh node:19-buster ${{matrix.cpu.platform}}
|
|
179
|
-
./tests/load-test.sh node:19-bullseye ${{matrix.cpu.platform}}
|
|
180
|
-
|
|
181
|
-
- name: Test NAPI file in linux_musl containers
|
|
182
|
-
if: matrix.image == 'linux_musl'
|
|
183
|
-
run: |
|
|
184
|
-
./tests/load-test.sh node:18-alpine3.15 ${{matrix.cpu.platform}}
|
|
185
|
-
./tests/load-test.sh node:16-alpine3.15 ${{matrix.cpu.platform}}
|
|
186
|
-
|
|
187
|
-
windows-napi:
|
|
188
|
-
name: Build NAPI windows - Node ${{matrix.nodejs}} - ${{matrix.arch}}
|
|
189
|
-
runs-on: windows-2022
|
|
190
|
-
timeout-minutes: 3000
|
|
191
|
-
|
|
192
|
-
strategy:
|
|
193
|
-
fail-fast: false
|
|
194
|
-
matrix:
|
|
195
|
-
arch:
|
|
196
|
-
- x64
|
|
197
|
-
- x86
|
|
198
|
-
nodejs:
|
|
199
|
-
- 18
|
|
200
|
-
python:
|
|
201
|
-
- "3.10"
|
|
202
|
-
steps:
|
|
203
|
-
- uses: actions/checkout@v3
|
|
204
|
-
- name: Use Node.js ${{ matrix.nodejs }}
|
|
205
|
-
uses: actions/setup-node@v3
|
|
206
|
-
with:
|
|
207
|
-
node-version: ${{ matrix.nodejs }}
|
|
208
|
-
architecture: ${{ matrix.arch }}
|
|
209
|
-
cache: 'npm'
|
|
210
|
-
|
|
211
|
-
- name: Use Python ${{ matrix.python }}
|
|
212
|
-
uses: actions/setup-python@v3
|
|
213
|
-
with:
|
|
214
|
-
python-version: ${{ matrix.python }}
|
|
215
|
-
|
|
216
|
-
- name: Cache CPP Client
|
|
217
|
-
id: cache-dependencies
|
|
218
|
-
uses: actions/cache@v3
|
|
219
|
-
with:
|
|
220
|
-
path: pkg/windows/
|
|
221
|
-
key: ${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('pulsar-client-cpp.txt') }}
|
|
222
|
-
|
|
223
|
-
- name: Add env vars
|
|
224
|
-
shell: bash
|
|
225
|
-
run: |
|
|
226
|
-
if [ "${{ matrix.arch }}" = "x86" ]; then
|
|
227
|
-
echo "TARGET=ia32" >> $GITHUB_ENV
|
|
228
|
-
else
|
|
229
|
-
echo "TARGET=${{ matrix.arch }}" >> $GITHUB_ENV
|
|
230
|
-
fi
|
|
231
|
-
|
|
232
|
-
- name: Download CPP Client
|
|
233
|
-
if: steps.cache-dependencies.outputs.cache-hit != 'true'
|
|
234
|
-
run: |
|
|
235
|
-
pkg/windows/download-cpp-client.bat ${{ matrix.arch }}
|
|
236
|
-
|
|
237
|
-
- name: Build Node binaries lib
|
|
238
|
-
run: |
|
|
239
|
-
npm install --ignore-scripts
|
|
240
|
-
npx node-pre-gyp configure --target_arch=${{ env.TARGET }}
|
|
241
|
-
npx node-pre-gyp build --target_arch=${{ env.TARGET }}
|
|
242
|
-
|
|
243
|
-
- name: Test loading Node binaries lib
|
|
244
|
-
run: |
|
|
245
|
-
node pkg/load_test.js
|
|
246
|
-
|
|
247
|
-
- name: Package Node binaries lib
|
|
248
|
-
run: |
|
|
249
|
-
npx node-pre-gyp package --target_arch=${{ env.TARGET }}
|
|
250
|
-
|
|
251
|
-
macos-napi-homebrew:
|
|
252
|
-
name: Build NAPI macos with CPP lib installed by Homebrew
|
|
253
|
-
runs-on: macos-latest
|
|
254
|
-
timeout-minutes: 3000
|
|
255
|
-
strategy:
|
|
256
|
-
fail-fast: false
|
|
257
|
-
matrix:
|
|
258
|
-
python:
|
|
259
|
-
- "3.10"
|
|
260
|
-
|
|
261
|
-
steps:
|
|
262
|
-
- uses: actions/checkout@v3
|
|
263
|
-
- name: Use Node.js 18
|
|
264
|
-
uses: actions/setup-node@v3
|
|
265
|
-
with:
|
|
266
|
-
node-version: 18
|
|
267
|
-
cache: 'npm'
|
|
268
|
-
- name: Use Python ${{ matrix.python }}
|
|
269
|
-
uses: actions/setup-python@v3
|
|
270
|
-
with:
|
|
271
|
-
python-version: ${{ matrix.python }}
|
|
272
|
-
- name: Install CPP lib
|
|
273
|
-
run: |
|
|
274
|
-
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=true
|
|
275
|
-
brew update
|
|
276
|
-
brew install libpulsar
|
|
277
|
-
- name: Build Node binaries lib
|
|
278
|
-
run: |
|
|
279
|
-
npm install --ignore-scripts
|
|
280
|
-
npx node-pre-gyp configure
|
|
281
|
-
npx node-pre-gyp build
|
|
282
|
-
- name: Test loading Node binaries lib
|
|
283
|
-
run: |
|
|
284
|
-
node pkg/load_test.js
|
|
285
|
-
- name: Package Node binaries lib
|
|
286
|
-
run: |
|
|
287
|
-
npx node-pre-gyp package
|
|
288
|
-
|
|
289
|
-
linux-napi-apt:
|
|
290
|
-
name: Build NAPI linux with CPP lib installed by APT
|
|
291
|
-
runs-on: ubuntu-22.04
|
|
292
|
-
timeout-minutes: 3000
|
|
293
|
-
strategy:
|
|
294
|
-
fail-fast: false
|
|
295
|
-
matrix:
|
|
296
|
-
python:
|
|
297
|
-
- "3.10"
|
|
298
|
-
|
|
299
|
-
steps:
|
|
300
|
-
- uses: actions/checkout@v3
|
|
301
|
-
- name: Use Node.js 18
|
|
302
|
-
uses: actions/setup-node@v3
|
|
303
|
-
with:
|
|
304
|
-
node-version: 18
|
|
305
|
-
cache: 'npm'
|
|
306
|
-
|
|
307
|
-
- name: Use Python ${{ matrix.python }}
|
|
308
|
-
uses: actions/setup-python@v3
|
|
309
|
-
with:
|
|
310
|
-
python-version: ${{ matrix.python }}
|
|
311
|
-
|
|
312
|
-
- name: Install CPP lib
|
|
313
|
-
run: |
|
|
314
|
-
source pulsar-client-cpp.txt
|
|
315
|
-
UNAME_ARCH=$(uname -m)
|
|
316
|
-
if [ $UNAME_ARCH == 'aarch64' ]; then
|
|
317
|
-
PLATFORM='arm64'
|
|
318
|
-
else
|
|
319
|
-
PLATFORM='x86_64'
|
|
320
|
-
fi
|
|
321
|
-
curl -s -L -O ${CPP_CLIENT_BASE_URL}/deb-${PLATFORM}/apache-pulsar-client.deb
|
|
322
|
-
curl -s -L -O ${CPP_CLIENT_BASE_URL}/deb-${PLATFORM}/apache-pulsar-client-dev.deb
|
|
323
|
-
sudo -E apt -y install ./apache-pulsar-client.deb ./apache-pulsar-client-dev.deb
|
|
324
|
-
- name: Build Node binaries lib
|
|
325
|
-
run: |
|
|
326
|
-
npm install --ignore-scripts
|
|
327
|
-
npx node-pre-gyp configure
|
|
328
|
-
npx node-pre-gyp build
|
|
329
|
-
- name: Test loading Node binaries lib
|
|
330
|
-
run: |
|
|
331
|
-
node pkg/load_test.js
|
|
332
|
-
- name: Package Node binaries lib
|
|
333
|
-
run: |
|
|
334
|
-
npx node-pre-gyp package
|