Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit 39927fa

Browse files
authored
feat: add ci for build and zemu test (#12)
1 parent 2ac7285 commit 39927fa

File tree

8 files changed

+79
-49
lines changed

8 files changed

+79
-49
lines changed

.github/workflows/main.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build
2+
on:
3+
workflow_dispatch:
4+
push:
5+
pull_request:
6+
branches:
7+
- main
8+
- develop
9+
- master # for safety reasons
10+
- dev # for safety reasons
11+
12+
jobs:
13+
configure:
14+
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
15+
outputs:
16+
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
17+
steps:
18+
- id: get-user
19+
run: echo "uid_gid=$(id -u):$(id -g)" >> $GITHUB_OUTPUT
20+
21+
build_ledger:
22+
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
23+
steps:
24+
- name: Install dependencies
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y curl protobuf-compiler build-essential git wget unzip python3 python3-pip \
28+
libssl-dev libffi-dev libreadline-dev zlib1g-dev libbz2-dev libsqlite3-dev libncurses5-dev \
29+
libgdbm-dev libnss3-dev liblzma-dev libxml2-dev libxmlsec1-dev libffi-dev libyaml-dev \
30+
clang gcc-arm-none-eabi gcc-multilib llvm-dev llvm
31+
- name: Install rust
32+
uses: actions-rs/toolchain@v1
33+
with:
34+
toolchain: nightly-2023-11-10
35+
components: rust-src
36+
- uses: actions/setup-python@v5
37+
with:
38+
python-version: '3.12'
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
with:
42+
submodules: true
43+
- name: Install node
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: 18
47+
- name: Install yarn
48+
run: |
49+
npm install -g yarn
50+
- name: Install ledger deps
51+
run: |
52+
cargo install cargo-ledger
53+
cargo ledger setup
54+
pip install ledgerwallet
55+
- name: Build app
56+
run: |
57+
export PATH=/home/runner/.local/bin:$PATH
58+
make build
59+
- name: Install zemu deps
60+
run: make zemu_install
61+
- name: Run tests
62+
run: make zemu_test

.github/workflows/python_tests_checks.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "js"]
22
path = js
33
url = https://github.com/Zondax/ledger-ironfish-js
4+
[submodule "ironfish"]
5+
path = ironfish
6+
url = https://github.com/iron-fish/ironfish

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,16 @@ zemu_install_js_link:
2727
endif
2828

2929

30+
zemu_install_ironfish_link:
31+
cd ironfish && yarn unlink || true
32+
cd $(TESTS_ZEMU_DIR) && yarn unlink @ironfish/rust-nodejs || true
33+
cd $(TESTS_JS_DIR) && yarn unlink @ironfish/rust-nodejs || true
34+
# Now build and link
35+
cd ironfish && yarn install && cd ironfish-rust-nodejs && yarn link || true
36+
cd $(TESTS_ZEMU_DIR) && yarn link @ironfish/rust-nodejs || true
37+
cd $(TESTS_JS_DIR) && yarn link @ironfish/rust-nodejs || true
3038
.PHONY: zemu_install
31-
zemu_install: zemu_install_js_link
39+
zemu_install: zemu_install_ironfish_link zemu_install_js_link
3240
# and now install everything
3341
cd $(TESTS_ZEMU_DIR) && yarn install
3442

ironfish

Submodule ironfish added at 5c87a00

js

Submodule js updated 1 file

tests_zemu/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"upgrade": "bunx npm-check-updates -i"
2525
},
2626
"dependencies": {
27-
"@ironfish/rust-nodejs": "file:../../../otros/ironfish/ironfish-rust-nodejs",
27+
"@ironfish/rust-nodejs": "../ironfish/ironfish-rust-nodejs",
2828
"@ironfish/sdk": "^2.5.0",
2929
"@zondax/ledger-ironfish": "../js",
3030
"@zondax/zemu": "^0.50.2"

tests_zemu/yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@
496496
resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.0.tgz#6d86b8cb322660f03d3f0aa94b99bdd8e172d570"
497497
integrity sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==
498498

499-
"@ironfish/rust-nodejs@2.5.0", "@ironfish/rust-nodejs@file:../../../otros/ironfish/ironfish-rust-nodejs":
499+
"@ironfish/rust-nodejs@../ironfish/ironfish-rust-nodejs", "@ironfish/rust-nodejs@2.5.0":
500500
version "2.5.0"
501501

502502
"@ironfish/sdk@^2.5.0":
@@ -1425,7 +1425,7 @@
14251425
"@zondax/ledger-ironfish@../js":
14261426
version "0.0.0"
14271427
dependencies:
1428-
"@ironfish/rust-nodejs" "file:../../../../../../Library/Caches/Yarn/v6/npm-@zondax-ledger-ironfish-0.0.0-2140b009-22cd-4404-8a96-d84e7efa8c61-1726092072851/otros/ironfish/ironfish-rust-nodejs"
1428+
"@ironfish/rust-nodejs" "../ironfish/ironfish-rust-nodejs"
14291429
"@zondax/ledger-js" "^0.2.1"
14301430

14311431
"@zondax/ledger-js@^0.2.1":

0 commit comments

Comments
 (0)