Skip to content

Commit b517393

Browse files
authored
Merge pull request #45 from EmbeddedEnterprises/ci
test: run the zeromq tests in CI + smoke tests
2 parents dc55ee2 + a883c51 commit b517393

File tree

7 files changed

+214
-534
lines changed

7 files changed

+214
-534
lines changed

.github/workflows/CI.yml

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
branches:
55
- master
66
pull_request:
7+
workflow_dispatch:
78

89
jobs:
910
Test:
@@ -15,18 +16,10 @@ jobs:
1516
- ubuntu-latest
1617
- macos-13
1718
- windows-latest
18-
node_version:
19-
- 20
20-
- 22
2119
cpp_arch:
2220
- x64
2321
include:
2422
- os: macos-14 # arm
25-
node-version: 16
26-
cpp_arch: arm64
27-
28-
- os: macos-14 # arm
29-
node-version: 22
3023
cpp_arch: arm64
3124
steps:
3225
- uses: actions/checkout@v4
@@ -35,20 +28,40 @@ jobs:
3528

3629
- uses: actions/setup-node@v4
3730
with:
38-
node-version: ${{ matrix.node_version }}
31+
node-version-file: .nvmrc
3932

4033
- uses: pnpm/action-setup@v4
4134

42-
# - name: Setup Cpp
43-
# if: ${{ matrix.native }}
44-
# uses: aminya/setup-cpp@v1
45-
# with:
46-
# vcvarsall: true
47-
# cmake: true
48-
# ninja: true
49-
# python: true
50-
# vcpkg: ee2d2a100103e0f3613c60655dcf15be7d5157b8
51-
# architecture: ${{ matrix.cpp_arch }}
35+
- name: Setup Cpp
36+
uses: aminya/setup-cpp@v1
37+
with:
38+
vcvarsall: true
39+
cmake: true
40+
ninja: true
41+
python: true
42+
vcpkg: 608d1dbcd6969679f82b1ca6b89d58939c9b228e
43+
architecture: ${{ matrix.cpp_arch }}
44+
45+
- name: Cache
46+
uses: actions/cache@v4
47+
with:
48+
path: |
49+
./node_modules
50+
~/.pnpm-store
51+
~/vcpkg
52+
key: ${{ matrix.os }}-${{ matrix.cpp_arch }}-${{ hashFiles('pnpm-lock.yaml', 'package.json') }}
53+
restore-keys: |
54+
${{ matrix.os }}-${{ matrix.cpp_arch }}-
55+
56+
- name: Install Zeromq Mac-OS Dependencies
57+
if: ${{ contains(matrix.os, 'macos') }}
58+
run: |
59+
brew install gnutls autoconf automake libtool
60+
- name: Install Zeromq Ubuntu Dependencies
61+
if: ${{ contains(matrix.os, 'ubuntu') }}
62+
run: |
63+
sudo apt-get update -q -y
64+
sudo apt-get install -y --no-install-recommends autoconf automake libtool
5265
5366
- name: Install dependencies
5467
run: pnpm install
@@ -61,3 +74,13 @@ jobs:
6174

6275
- name: Tests
6376
run: pnpm test
77+
78+
- name: Setup Node 12
79+
if: matrix.os != 'macos-14'
80+
uses: actions/setup-node@v4
81+
with:
82+
node-version: 12
83+
84+
- name: Smoke test Node 12
85+
if: matrix.os != 'macos-14'
86+
run: node ./build/main.js --help

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.14.0

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,31 @@ Usage: cmake-ts build [options]
2828
Build the project
2929

3030
Options:
31-
-c, --configs <configs...>
31+
-c, --configs <configs...>
3232
Named config(s) to build, which could be from default configs or the ones defined in the config file (package.json)
33-
33+
3434
If no config is provided, it will build for the current runtime on the current system with the Release build type
35-
35+
3636
The default configs are combinations of `<Runtime>`, `<BuildType>`, `<Platform>`, and `<Architecture>`.
37-
37+
3838
- `<Runtime>`: the runtime to use
39-
39+
4040
e.g.: `node`, `electron`, `iojs`
41-
41+
4242
- `<BuildType>`: the cmake build type (optimization level)
43-
43+
4444
e.g.: `debug`, `release`, or `relwithdebinfo`
45-
45+
4646
- `<Platform>`: the target platform
47-
47+
4848
e.g.: `win32`, `linux`, `darwin`, `aix`, `android`, `freebsd`, `haiku`, `openbsd`, `sunos`, `cygwin`, `netbsd`
49-
49+
5050
- `<Architecture>`: the target architecture
51-
51+
5252
e.g.: `x64`, `arm64`, `ia32`, `arm`, `loong64`, `mips`, `mipsel`, `ppc`, `ppc64`, `riscv64`, `s390`, `s390x`
53-
53+
5454
Any combination of `<BuildType>`, `<Runtime>`, `<Platform>`, and `<Architecture>` is valid. Some examples:
55-
55+
5656
- `release`
5757
- `debug`
5858
- `relwithdebinfo`
@@ -68,20 +68,20 @@ Options:
6868
- `darwin-x64-node-release`
6969
- `darwin-arm64-node-release`
7070
- `darwin-arm64-electron-relwithdebinfo`
71-
71+
7272
You can also define your own configs in the config file (package.json).
73-
73+
7474
- `<ConfigName>`: the name of the config
75-
75+
7676
e.g.: `my-config`
77-
77+
7878
The configs can also be in format of `named-<property>`, which builds the configs that match the property.
79-
79+
8080
- `named-os`: build all the configs in the config file that have the same OS
8181
- `named-os-dev`: build all the configs in the config file that have the same OS and `dev` is true
8282
- `named-all`: build all the configs in the config file
83-
84-
83+
84+
8585
The configs can be combined with `,` or multiple `--configs` flags. They will be merged together.
8686
(default: [])
8787
-h, --help display help for command

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@
102102
"@biomejs/biome": "^1.9.4",
103103
"prettier": "^3.5.3",
104104
"prettier-config-atomic": "^4.0.0",
105-
"zeromq": "^6.3.0",
105+
"execa": "^9.5.2",
106+
"zeromq": "^6.4.1",
106107
"ci-info": "^4.2.0",
107108
"fast-glob": "^3.3.2",
108109
"fs-extra": "^10",
@@ -120,6 +121,9 @@
120121
"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/package.json",
121122
"pnpm": {
122123
"onlyBuiltDependencies": ["@biomejs/biome", "core-js", "esbuild"],
123-
"ignoredBuiltDependencies": ["zeromq"]
124+
"ignoredBuiltDependencies": ["zeromq"],
125+
"patchedDependencies": {
126+
"zeromq": "patches/zeromq.patch"
127+
}
124128
}
125129
}

patches/zeromq.patch

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/src/module.h b/src/module.h
2+
index b28d789c8c950efaafd2c36b7d14351686cb7712..79d190e4fb0a0d731070597e46feffd091efebaf 100644
3+
--- a/src/module.h
4+
+++ b/src/module.h
5+
@@ -2,6 +2,7 @@
6+
7+
#include <cstdio>
8+
#include <future>
9+
+#include <chrono>
10+
11+
#include "./closable.h"
12+
#include "./outgoing_msg.h"

0 commit comments

Comments
 (0)