Skip to content

Commit 1b2c644

Browse files
committed
test(crypto-nodejs): Set up CI to run the test suites.
1 parent 6d8c54d commit 1b2c644

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,48 @@ jobs:
119119
uses: actions-rs/cargo@v1
120120
with:
121121
command: test
122+
123+
test-nodejs:
124+
name: linux / node.js (${{ matrix.node-version }})
125+
if: github.event_name == 'push' || !github.event.pull_request.draft
126+
127+
runs-on: ubuntu-latest
128+
strategy:
129+
fail-fast: true
130+
matrix:
131+
node-version: [12.17, 14.0, 15.0, 16.0]
132+
include:
133+
- node-version: 16.0
134+
build-doc: true
135+
136+
steps:
137+
- name: Checkout the repo
138+
uses: actions/checkout@v2
139+
140+
- name: Install Rust
141+
uses: actions-rs/toolchain@v1
142+
with:
143+
toolchain: stable
144+
profile: minimal
145+
override: true
146+
147+
- name: Load cache
148+
uses: Swatinem/rust-cache@v1
149+
150+
- name: Install Node.js
151+
uses: actions/setup-node@v3
152+
with:
153+
node-version: ${{ matrix.node-version }}
154+
155+
- name: Install NPM dependencies
156+
run: cd crates/matrix-sdk-crypto-nodejs && npm install
157+
158+
- name: Build the Node.js binding
159+
run: cd crates/matrix-sdk-crypto-nodejs && npm run build
160+
161+
- name: Test the Node.js binding
162+
run: cd crates/matrix-sdk-crypto-nodejs && npm run test
163+
164+
- if: ${{ matrix.build-doc }}
165+
name: Build the documentation
166+
run: cd crates/matrix-sdk-crypto-nodejs && npm run doc

crates/matrix-sdk-crypto-nodejs/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ Node.js and npm
1919
Page](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
2020

2121
The binding is using NAPI 6 (Node API version 6), which means that is
22-
compatible with Node.js versions 10.20.0, 12.17.0, 14.0.0, 15.0.0 and
23-
16.0.0 (see [the full Node API version
24-
matrix](https://nodejs.org/api/n-api.html#node-api-version-matrix)).
22+
compatible with Node.js versions 12.17.0, 14.0.0, 15.0.0 and 16.0.0
23+
(see [the full Node API version
24+
matrix](https://nodejs.org/api/n-api.html#node-api-version-matrix))
25+
(we do not support the version 10.20).
2526

2627
Once the Rust compiler, Node.js and npm are installed, you can run the
2728
following commands:

0 commit comments

Comments
 (0)