Skip to content

Commit dc3774c

Browse files
feat: use nwaku/go-waku docker images instead of building binaries (#1259)
* merge: master * fix: CI * use: js script instead of shell script to run precheck and mocha * use `console.log` instead of `debug.log` for `run-tests.js`
1 parent 0a80cd4 commit dc3774c

22 files changed

+546
-212
lines changed

.cspell.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@
114114
"webfonts",
115115
"websockets",
116116
"wifi",
117-
"xsalsa20"
117+
"xsalsa20",
118+
"statusteam"
118119
],
119120
"flagWords": [],
120121
"ignorePaths": [

.github/workflows/ci.yml

+8-60
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
pull_request:
1010

1111
env:
12-
NWAKU_VERSION: "v0.16.0"
1312
NODE_JS: "18"
1413

1514
jobs:
@@ -57,24 +56,15 @@ jobs:
5756

5857
node:
5958
runs-on: ubuntu-latest
59+
env:
60+
WAKUNODE_IMAGE: "statusteam/nim-waku:v0.16.0"
6061
steps:
6162
- uses: actions/checkout@v3
62-
- name: Get nwaku
63-
shell: bash
64-
run: |
65-
mkdir -p nwaku/build
66-
cd nwaku
67-
wget "https://github.com/status-im/nwaku/releases/download/${NWAKU_VERSION}/nim-waku-ubuntu-latest.tar.gz"
68-
tar xavf nim-waku-ubuntu-latest.tar.gz
69-
- name: Ensure wakunode2 is ready
70-
shell: bash
71-
run: |
72-
uname -a
73-
cd nwaku/build
74-
./wakunode2 --help
63+
7564
- uses: actions/setup-node@v3
7665
with:
7766
node-version: ${{ env.NODE_JS }}
67+
7868
- uses: ./.github/actions/npm
7969
- run: npm run build:esm
8070
- run: npm run test:node
@@ -95,35 +85,15 @@ jobs:
9585
name: nwaku-logs
9686
path: packages/tests/log/
9787

98-
node_with_go_waku:
88+
node_with_go_waku_master:
9989
runs-on: ubuntu-latest
10090
env:
101-
GO_WAKU_VERSION: "0.5.2"
102-
WAKU_SERVICE_NODE_DIR: ../../go-waku
103-
WAKU_SERVICE_NODE_BIN: ./waku
91+
WAKUNODE_IMAGE: "statusteam/go-waku:latest"
10492
WAKU_SERVICE_NODE_PARAMS: "--min-relay-peers-to-publish=0" # Can be removed once https://github.com/status-im/nwaku/issues/1004 is done
10593
DEBUG: "waku*"
10694
steps:
10795
- uses: actions/checkout@v3
10896

109-
- name: Get go-waku
110-
shell: bash
111-
run: |
112-
pwd
113-
mkdir -p go-waku/
114-
cd go-waku
115-
wget "https://github.com/status-im/go-waku/releases/download/v${GO_WAKU_VERSION}/gowaku-${GO_WAKU_VERSION}-x86_64.deb"
116-
sudo apt install ./gowaku-${GO_WAKU_VERSION}-x86_64.deb
117-
cp $(which waku) ./
118-
119-
- name: Ensure go-waku is ready
120-
shell: bash
121-
run: |
122-
uname -a
123-
cd packages/core
124-
cd "${WAKU_SERVICE_NODE_DIR}"
125-
"${WAKU_SERVICE_NODE_BIN}" --version
126-
12797
- name: Install NodeJS
12898
uses: actions/setup-node@v3
12999
with:
@@ -153,37 +123,15 @@ jobs:
153123
runs-on: ubuntu-latest
154124
env:
155125
DEBUG: "waku*"
126+
WAKUNODE_IMAGE: "statusteam/nim-waku:deploy-wakuv2-test"
156127
steps:
157128
- uses: actions/checkout@v3
158-
with:
159-
submodules: "recursive"
160-
fetch-depth: 0
161129

162-
- name: Install NodeJS
163-
uses: actions/setup-node@v3
130+
- uses: actions/setup-node@v3
164131
with:
165132
node-version: ${{ env.NODE_JS }}
166133

167-
- name: Pull nwaku origin/master
168-
run: |
169-
cd nwaku
170-
git fetch origin
171-
git checkout origin/master
172-
173134
- uses: ./.github/actions/npm
174-
175-
- name: build nwaku
176-
run: |
177-
cd packages/tests
178-
npm run nwaku:force-build
179-
180-
- name: Ensure wakunode2 is ready
181-
shell: bash
182-
run: |
183-
uname -a
184-
cd nwaku
185-
./build/wakunode2 --help
186-
187135
- run: npm run build:esm
188136
- run: npm run test:node
189137
env:

.gitmodules

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "nim-waku"]
2-
path = nwaku
3-
url = https://github.com/status-im/nim-waku.git

CONTRIBUTING.md

+8-11
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,21 @@ This project board is to prioritize the work of core contributors so do not be d
1111
Do note that we have a [CI](./.github/workflows/ci.yml) powered by GitHub Action.
1212
To help ensure your PR passes, just run before committing:
1313

14-
- `npm run fix`: To format your code,
15-
- `npm run test`: To run all tests, including lint checks.
16-
14+
- `npm run fix`: To format your code,
15+
- `npm run check`: To check your code for linting errors,
16+
- `npm run test`: To run all tests
1717

1818
## Build & Test
1919

2020
To build and test this repository, you need:
21-
22-
- [Node.js & npm](https://nodejs.org/en/).
23-
- Chrome (for browser testing).
24-
- g++ & make (to build nim-waku)
21+
22+
- [Node.js & npm](https://nodejs.org/en/).
23+
- Chrome (for browser testing).
2524

2625
To ensure interoperability with [nim-waku](https://github.com/status-im/nim-waku/), some tests are run against a nim-waku node.
27-
This is why `nim-waku` is present as a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules), which itself contain several submodules.
28-
At this stage, it is not possible to exclude nim-waku tests, hence `git submodule update --init --recursive` is run before testing (see [`pretest` script](https://github.com/status-im/js-waku/blob/master/package.json)).
26+
This is why the relevant docker images for the node is pulled as part of the `pretest` script that runs before `npm run test`.
2927

30-
If you do not want to run `npm run test`, you can still build nim-waku by running `npm run pretest`.
28+
If you do not want to run `npm run test`, you can still pull the relevant nim-waku docker image by running `npm run pretest`.
3129

3230
Note that we run tests in both NodeJS and browser environments (using [karma](https://karma-runner.github.io/)).
3331
Files named `*.node.spec.ts` are only run in NodeJS environment;
@@ -62,4 +60,3 @@ Commit messages should never contain any `@` mentions (usernames prefixed with "
6260

6361
Please refer to the [Git manual](https://git-scm.com/doc) for more information
6462
about Git.
65-

nwaku

-1
This file was deleted.

0 commit comments

Comments
 (0)