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

feat: add ci for build and zemu test #12

Merged
merged 20 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build
on:
workflow_dispatch:
push:
pull_request:
branches:
- main
- develop
- master # for safety reasons
- dev # for safety reasons

jobs:
configure:
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
outputs:
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
steps:
- id: get-user
run: echo "uid_gid=$(id -u):$(id -g)" >> $GITHUB_OUTPUT

build_ledger:
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl protobuf-compiler build-essential git wget unzip python3 python3-pip \
libssl-dev libffi-dev libreadline-dev zlib1g-dev libbz2-dev libsqlite3-dev libncurses5-dev \
libgdbm-dev libnss3-dev liblzma-dev libxml2-dev libxmlsec1-dev libffi-dev libyaml-dev \
clang gcc-arm-none-eabi gcc-multilib llvm-dev llvm
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2023-11-10
components: rust-src
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Install node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install yarn
run: |
npm install -g yarn
- name: Install ledger deps
run: |
cargo install cargo-ledger
cargo ledger setup
pip install ledgerwallet
- name: Build app
run: |
export PATH=/home/runner/.local/bin:$PATH
make build
- name: Install zemu deps
run: make zemu_install
- name: Run tests
run: make zemu_test
44 changes: 0 additions & 44 deletions .github/workflows/python_tests_checks.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "js"]
path = js
url = https://github.com/Zondax/ledger-ironfish-js
[submodule "ironfish"]
path = ironfish
url = https://github.com/iron-fish/ironfish
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,16 @@ zemu_install_js_link:
endif


zemu_install_ironfish_link:
cd ironfish && yarn unlink || true
cd $(TESTS_ZEMU_DIR) && yarn unlink @ironfish/rust-nodejs || true
cd $(TESTS_JS_DIR) && yarn unlink @ironfish/rust-nodejs || true
# Now build and link
cd ironfish && yarn install && cd ironfish-rust-nodejs && yarn link || true
cd $(TESTS_ZEMU_DIR) && yarn link @ironfish/rust-nodejs || true
cd $(TESTS_JS_DIR) && yarn link @ironfish/rust-nodejs || true
.PHONY: zemu_install
zemu_install: zemu_install_js_link
zemu_install: zemu_install_ironfish_link zemu_install_js_link
# and now install everything
cd $(TESTS_ZEMU_DIR) && yarn install

Expand Down
1 change: 1 addition & 0 deletions ironfish
Submodule ironfish added at 5c87a0
2 changes: 1 addition & 1 deletion js
Submodule js updated 1 files
+1 −1 package.json
2 changes: 1 addition & 1 deletion tests_zemu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"upgrade": "bunx npm-check-updates -i"
},
"dependencies": {
"@ironfish/rust-nodejs": "file:../../../otros/ironfish/ironfish-rust-nodejs",
"@ironfish/rust-nodejs": "../ironfish/ironfish-rust-nodejs",
"@ironfish/sdk": "^2.5.0",
"@zondax/ledger-ironfish": "../js",
"@zondax/zemu": "^0.50.2"
Expand Down
4 changes: 2 additions & 2 deletions tests_zemu/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@
resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.0.tgz#6d86b8cb322660f03d3f0aa94b99bdd8e172d570"
integrity sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==

"@ironfish/rust-nodejs@2.5.0", "@ironfish/rust-nodejs@file:../../../otros/ironfish/ironfish-rust-nodejs":
"@ironfish/rust-nodejs@../ironfish/ironfish-rust-nodejs", "@ironfish/rust-nodejs@2.5.0":
version "2.5.0"

"@ironfish/sdk@^2.5.0":
Expand Down Expand Up @@ -1425,7 +1425,7 @@
"@zondax/ledger-ironfish@../js":
version "0.0.0"
dependencies:
"@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"
"@ironfish/rust-nodejs" "../ironfish/ironfish-rust-nodejs"
"@zondax/ledger-js" "^0.2.1"

"@zondax/ledger-js@^0.2.1":
Expand Down Expand Up @@ -4829,7 +4829,7 @@
require-from-string@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==

Check failure on line 4832 in tests_zemu/yarn.lock

View workflow job for this annotation

GitHub Actions / Check misspellings

vEw ==> view, vow, vex

resolve-cwd@^3.0.0:
version "3.0.0"
Expand Down
Loading