1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Node
on:
push:
branches:
paths:
- ".github/workflows/node.yml"
- "node/mq-bridge-node/**"
- "Cargo.toml"
- "Cargo.lock"
- "src/**"
pull_request:
branches:
paths:
- ".github/workflows/node.yml"
- "node/mq-bridge-node/**"
- "Cargo.toml"
- "Cargo.lock"
- "src/**"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Node binding smoke test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: node/mq-bridge-node/package-lock.json
- name: Cache cargo registry
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-node-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-node-cargo-
- name: Install Node dependencies
working-directory: node/mq-bridge-node
run: npm ci
- name: Check Rust binding
run: cargo check -p mq-bridge-node --no-default-features --features "http middleware schema"
- name: Build native addon
working-directory: node/mq-bridge-node
run: npm run build:ci
- name: Run Node tests
working-directory: node/mq-bridge-node
run: npm test