Skip to content

Commit 31db121

Browse files
authored
Run tests on GitHub; upgrade to latest @zondax/ledger-cosmos-js and support Node 22+24 (#1673)
* Add tests jobs on GH Actions * Add FetchError to list of expected errors * Migrate to latest @zondax/ledger-cosmos-js * Try Node version 22 again * Try Node 24 * Remove test-node CircleCI job
1 parent 95918db commit 31db121

File tree

80 files changed

+538
-1248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+538
-1248
lines changed

.circleci/config.yml

Lines changed: 0 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ workflows:
1414
matrix:
1515
parameters:
1616
simapp: ["simapp47", "simapp50"]
17-
- test-node:
18-
requires:
19-
- build
20-
matrix:
21-
parameters:
22-
node-version: ["18", "20"]
2317
- test-chrome:
2418
requires:
2519
- build
@@ -186,142 +180,6 @@ jobs:
186180
./scripts/<< parameters.simapp >>/stop.sh
187181
./scripts/<< parameters.simapp >>/slow_stop.sh
188182
./scripts/wasmd/stop.sh
189-
test-node:
190-
parameters:
191-
node-version:
192-
type: string
193-
machine:
194-
# We can't use a containerized environment since it requires remote docker to start custom containers.
195-
# However, we can't access the remote docker's network from the primary container. This is a
196-
# feature, as documented in https://circleci.com/docs/2.0/building-docker-images/#separation-of-environments
197-
# As a consequence, we cannot use the circleci CLI for this job because "You cannot use the machine
198-
# executor in local jobs." (https://circleci.com/docs/2.0/local-cli/#limitations-of-running-jobs-locally)
199-
#
200-
# Available images: https://circleci.com/developer/machine/image/ubuntu-2004
201-
# Note that ubuntu-2004:202111-02 and above cause checksum issues when installing yarn packages. No idea why.
202-
image: ubuntu-2004:202111-02
203-
resource_class: large
204-
steps:
205-
- run:
206-
name: Install Git Large File Storage (LFS)
207-
# In the current image, `sudo apt install git-lfs` requires `sudo apt update` which is too slow
208-
command: |
209-
wget -O "$HOME/git-lfs.deb" https://packagecloud.io/github/git-lfs/packages/ubuntu/focal/git-lfs_2.13.3_amd64.deb/download.deb
210-
sudo dpkg -i "$HOME/git-lfs.deb"
211-
- checkout
212-
- run: # start early for less wait time below
213-
name: Start wasmd
214-
command: ./scripts/wasmd/start.sh
215-
background: true
216-
- run:
217-
name: Start simapp
218-
command: ./scripts/simapp50/start.sh
219-
background: true
220-
- run:
221-
name: Start slow simapp
222-
command: ./scripts/simapp50/slow_start.sh
223-
background: true
224-
- run:
225-
name: Start Tendermint blockchains
226-
command: ./scripts/tendermint/all_start.sh
227-
background: true
228-
- attach_workspace:
229-
at: /tmp/builds
230-
- run:
231-
name: Merge build folders into project (merge with hardlinks)
232-
command: cp --recursive --link /tmp/builds/* .
233-
- run:
234-
# The images comes with preinstalled nvm, which does not work well with non-login shells
235-
name: Uninstall nvm
236-
# Moving to trash is faster than deleting (gvfs-trash is not installed on this image)
237-
command: |
238-
nvm --version && nvm ls
239-
mkdir -p ~/.local/share/Trash && mv "$NVM_DIR" ~/.npm ~/.local/share/Trash
240-
- run:
241-
name: Install nodejs
242-
# In the current image, `sudo apt install nodejs` requires `sudo apt update` which is too slow.
243-
# Follow instructions of https://deb.nodesource.com/ except the last step. Then run
244-
# `apt download --print-uris nodejs` to get a download URL.
245-
command: |
246-
declare -A node_links=(
247-
["18"]="https://deb.nodesource.com/node_18.x/pool/main/n/nodejs/nodejs_18.17.1-1nodesource1_amd64.deb"
248-
["20"]="https://deb.nodesource.com/node_20.x/pool/main/n/nodejs/nodejs_20.6.0-1nodesource1_amd64.deb"
249-
)
250-
wget -O "$HOME/nodejs.deb" "${node_links[<< parameters.node-version >>]}"
251-
sudo dpkg -i "$HOME/nodejs.deb"
252-
- run:
253-
name: Install yarn
254-
command: |
255-
wget -O "$HOME/yarn.deb" https://dl.yarnpkg.com/debian/pool/main/y/yarn/yarn_1.22.15_all.deb
256-
sudo dpkg -i "$HOME/yarn.deb"
257-
- run:
258-
name: Version information
259-
command: echo "node $(node --version)"; echo "yarn $(yarn --version)"
260-
- run:
261-
name: Install libusb
262-
# In the current image, `sudo apt install libusb-1.0-0-dev` requires `sudo apt update` which is too slow
263-
command: |
264-
wget -O "$HOME/libusb.deb" http://de.archive.ubuntu.com/ubuntu/pool/main/libu/libusb-1.0/libusb-1.0-0-dev_1.0.23-2build1_amd64.deb
265-
sudo dpkg -i "$HOME/libusb.deb"
266-
- run:
267-
name: Install libudev-dev
268-
# See https://packages.ubuntu.com/focal/libudev-dev (Ubuntu 20.04)
269-
command: |
270-
wget -O "$HOME/libudev1.deb" http://security.ubuntu.com/ubuntu/pool/main/s/systemd/libudev1_245.4-4ubuntu3.20_amd64.deb
271-
wget -O "$HOME/libudev-dev.deb" http://security.ubuntu.com/ubuntu/pool/main/s/systemd/libudev-dev_245.4-4ubuntu3.20_amd64.deb
272-
sudo dpkg -i "$HOME/libudev1.deb"
273-
sudo dpkg -i "$HOME/libudev-dev.deb"
274-
- run:
275-
name: Install Dependencies
276-
command: yarn install --immutable --immutable-cache --check-cache
277-
- run:
278-
name: Initialize wasmd (deploy contracts and friends)
279-
command: ./scripts/wasmd/init.sh
280-
- run:
281-
name: Start socket server
282-
command: ./scripts/socketserver/start.sh
283-
- run:
284-
name: Start http server
285-
command: ./scripts/httpserver/start.sh
286-
- run:
287-
environment:
288-
HTTPSERVER_ENABLED: 1
289-
SIMAPP50_ENABLED: 1
290-
SLOW_SIMAPP50_ENABLED: 1
291-
TENDERMINT_ENABLED: 1
292-
SOCKETSERVER_ENABLED: 1
293-
SKIP_BUILD: 1
294-
WASMD_ENABLED: 1
295-
# Stopped working for Node.js 20. Maybe we need to upgrade the dependency or something.
296-
# SES_ENABLED: 1
297-
command: yarn test --stream
298-
- run:
299-
name: Run CLI selftest
300-
working_directory: packages/cli
301-
environment:
302-
SKIP_BUILD: 1
303-
command: yarn selftest
304-
- run:
305-
name: Run CLI examples
306-
working_directory: packages/cli
307-
environment:
308-
HTTPSERVER_ENABLED: 1
309-
SIMAPP50_ENABLED: 1
310-
SLOW_SIMAPP50_ENABLED: 1
311-
TENDERMINT_ENABLED: 1
312-
SOCKETSERVER_ENABLED: 1
313-
SKIP_BUILD: 1
314-
WASMD_ENABLED: 1
315-
command: ./run_examples.sh
316-
- run:
317-
name: Stop chains
318-
command: |
319-
./scripts/httpserver/stop.sh
320-
./scripts/socketserver/stop.sh
321-
./scripts/tendermint/all_stop.sh
322-
./scripts/simapp50/stop.sh
323-
./scripts/simapp50/slow_stop.sh
324-
./scripts/wasmd/stop.sh
325183
test-chrome:
326184
machine:
327185
# We can't use a containerized environment since it requires remote docker to start custom containers.

.github/workflows/test.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ "main" ]
7+
8+
jobs:
9+
test:
10+
strategy:
11+
matrix:
12+
node-version: ["18", "20", "22", "24"]
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
lfs: true
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: "${{ matrix.node-version }}"
23+
cache: 'yarn'
24+
25+
- name: Start wasmd
26+
run: RUNNER_TRACKING_ID="" && ./scripts/wasmd/start.sh &
27+
- name: Start simapp
28+
run: RUNNER_TRACKING_ID="" && ./scripts/simapp50/start.sh &
29+
- name: Start slow simapp
30+
run: RUNNER_TRACKING_ID="" && ./scripts/simapp50/slow_start.sh &
31+
- name: Start Tendermint blockchains
32+
run: RUNNER_TRACKING_ID="" && ./scripts/tendermint/all_start.sh &
33+
- name: Start socket server
34+
run: RUNNER_TRACKING_ID="" && ./scripts/socketserver/start.sh &
35+
- name: Start http server
36+
run: RUNNER_TRACKING_ID="" && ./scripts/httpserver/start.sh &
37+
38+
- name: Install dependencies
39+
run: yarn install --immutable --immutable-cache --check-cache
40+
41+
- name: Build
42+
run: yarn build
43+
44+
- name: Initialize wasmd (deploy contracts and friends)
45+
run: ./scripts/wasmd/init.sh
46+
47+
- name: Test
48+
env:
49+
HTTPSERVER_ENABLED: 1
50+
SIMAPP50_ENABLED: 1
51+
SLOW_SIMAPP50_ENABLED: 1
52+
TENDERMINT_ENABLED: 1
53+
SOCKETSERVER_ENABLED: 1
54+
SKIP_BUILD: 1
55+
WASMD_ENABLED: 1
56+
# Stopped working for Node.js 20. Maybe we need to upgrade the dependency or something.
57+
# SES_ENABLED: 1
58+
run: yarn test --stream
59+
- name: Run CLI selftest
60+
working-directory: packages/cli
61+
env:
62+
SKIP_BUILD: 1
63+
run: yarn selftest
64+
- name: Run CLI examples
65+
working-directory: packages/cli
66+
env:
67+
HTTPSERVER_ENABLED: 1
68+
SIMAPP50_ENABLED: 1
69+
SLOW_SIMAPP50_ENABLED: 1
70+
TENDERMINT_ENABLED: 1
71+
SOCKETSERVER_ENABLED: 1
72+
SKIP_BUILD: 1
73+
WASMD_ENABLED: 1
74+
run: ./run_examples.sh

0 commit comments

Comments
 (0)