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

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
raynaudoe authored and jleni committed Apr 22, 2021
0 parents commit 223ff6b
Show file tree
Hide file tree
Showing 293 changed files with 60,120 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
190 changes: 190 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
version: 2
jobs:
build:
docker:
- image: zondax/circleci:latest
steps:
- checkout
- run: git submodule update --init --recursive
- run: cmake -DCMAKE_BUILD_TYPE=Debug . && make
# Unfortunately need to disable leak sanitizer https://github.com/google/sanitizers/issues/916
# Still run all other ASAN components
- run: GTEST_COLOR=1 ASAN_OPTIONS=detect_leaks=0 ctest -VV

build_only_rust:
docker:
- image: zondax/rust-ci:latest
steps:
- checkout
- run:
name: rustfmt
command: |
cd ~/project/app/rust
cargo fmt --version
cargo fmt -- --check
- run:
name: clippy
command: |
cd ~/project/app/rust
cargo clippy --version
cargo clippy --all-features --all-targets || true
- run:
name: audit
command: |
cd ~/project/app/rust
cargo audit --version
cargo audit
- run:
name: run tests
command: |
cd ~/project/app/rust
cargo test
build_ledger:
docker:
- image: zondax/builder-bolos:latest
working_directory: ~/project
environment:
BOLOS_SDK: /home/zondax/project/deps/nanos-secure-sdk
BOLOS_ENV: /opt/bolos
steps:
- checkout
# Docker entrypoint is not considered
- run: git submodule update --init --recursive
- run:
name: Build Standard light parser app
command: |
source /home/zondax/.cargo/env
make
- run:
name: Build Standard full parser app
command: |
source /home/zondax/.cargo/env
SUPPORT_SR25519=1 SUBSTRATE_PARSER_FULL=1 make
- run:
name: Build SR25519 app
command: |
source /home/zondax/.cargo/env
SUPPORT_SR25519=1 make
test_zemu:
machine:
image: ubuntu-2004:202101-01
resource_class: large
working_directory: ~/repo
environment:
BASH_ENV: "/opt/circleci/.nvm/nvm.sh"
steps:
- checkout
- run: git submodule update --init --recursive
- run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
- run:
name: Install rust
command: |
sudo apt-get update
sudo apt-get install -y cmake binutils-dev libcurl4-openssl-dev libiberty-dev libelf-dev libdw-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y;
no_output_timeout: 1800s
- run:
name: Install node + yarn
command: |
nvm install 14.4.0
nvm use 14.4.0
npm install -g yarn
- run:
name: Build Ledger app
command: |
SUBSTRATE_PARSER_FULL=1 make buildS
make clean
SUBSTRATE_PARSER_FULL=1 make buildX
- run:
name: Build/Install build js deps
command: |
nvm use 14.4.0
export PATH=~/.cargo/bin:$PATH
make zemu_install
- run:
name: Run zemu tests
command: |
nvm use 14.4.0
export PATH=~/.cargo/bin:$PATH
make zemu_test
test_zemu_sr25519:
machine:
image: ubuntu-2004:202101-01
resource_class: large
working_directory: ~/repo
environment:
BASH_ENV: "/opt/circleci/.nvm/nvm.sh"
steps:
- checkout
- run: git submodule update --init --recursive
- run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
- run:
name: Install rust
command: |
sudo apt-get update
sudo apt-get install -y cmake binutils-dev libcurl4-openssl-dev libiberty-dev libelf-dev libdw-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y;
no_output_timeout: 1800s
- run:
name: Install node + yarn
command: |
nvm install 14.4.0
nvm use 14.4.0
npm install -g yarn
- run:
name: Build Ledger app
command: |
make SUBSTRATE_PARSER_FULL=1 build_sr25519
- run:
name: Build/Install build js deps
command: |
nvm use 14.4.0
export PATH=~/.cargo/bin:$PATH
make zemu_install
- run:
name: Run zemu tests for sr25519
command: |
nvm use 14.4.0
export PATH=~/.cargo/bin:$PATH
cd tests_zemu && yarn testSR25519
build_package:
docker:
- image: zondax/builder-bolos@sha256:0e0097c01ef3c6c964fea8d8b6e3a584f4ff209a04ec68b6b2b4aeab64379c23
environment:
BOLOS_SDK: /home/zondax/project/deps/nanos-secure-sdk
BOLOS_ENV: /opt/bolos
steps:
- checkout
- run: git submodule update --init --recursive
- run:
name: Build
command: |
source /home/zondax/.cargo/env
cd /home/zondax/project
make
- run: /home/zondax/go/bin/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete $(/home/zondax/project/app/pkg/installer_s.sh version) /home/zondax/project/app/pkg/installer_s.sh

workflows:
version: 2

default:
jobs:
- build
- build_only_rust
- build_ledger
- test_zemu
- test_zemu_sr25519
- build_package:
requires:
- build
- build_ledger
- test_zemu
- test_zemu_sr25519
filters:
branches:
only:
- master
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# top-most EditorConfig file
root = true

[*]
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

[*.{c,h,cpp,hpp}]
indent_style = space
indent_size = 4

[*.{yml,sh}]
indent_style = space
indent_size = 2
11 changes: 11 additions & 0 deletions .gdbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# https://www.jetbrains.com/help/clion/configuring-debugger-options.html#gdbinit-lldbinit
#
# You need to create `$HOME/.gdbinit` with the following content:
# set auto-load local-gdbinit on
# add-auto-load-safe-path /

set architecture arm
handle SIGILL nostop pass noprint
add-symbol-file app/bin/app.elf 0x40000000
set backtrace limit 20
b *0x40000000
153 changes: 153 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: Build
on: [push]

jobs:
configure:
runs-on: ubuntu-latest
outputs:
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
steps:
- id: get-user
run: echo "::set-output name=uid_gid::$(id -u):$(id -g)"

build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Install deps
run: |
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
make deps
brew install conan
- run: cmake -DCMAKE_BUILD_TYPE=Debug . && make
- run: GTEST_COLOR=1 ASAN_OPTIONS=detect_leaks=0 ctest -VV

build_only_rust:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Install deps
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: rustfmt
run: |
cd ./app/rust
cargo fmt --version
cargo fmt -- --check
- name: clippy
run: |
cd ./app/rust
cargo clippy --version
cargo clippy --all-features --all-targets || true
- name: audit
run: |
cd ./app/rust
cargo audit --version
cargo audit
- name: run tests
run: |
cd ./app/rust
cargo test
build_ledger:
needs: configure
runs-on: ubuntu-latest
container:
image: zondax/builder-bolos:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: /__w/ledger-edgeware/ledger-edgeware/deps/nanos-secure-sdk
BOLOS_ENV: /opt/bolos
HOME: /home/zondax_circle
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Build Standard app
shell: bash -l {0}
run: |
source $HOME/.cargo/env
make
- name: Build SR25519 app
shell: bash -l {0}
run: |
source $HOME/.cargo/env
SUPPORT_SR25519=1 make
test_zemu:
runs-on: ubuntu-latest
steps:
- name: Test
run: |
id
echo $HOME
echo $DISPLAY
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
- name: Install rust
run: |
sudo apt-get update
sudo apt-get install -y cmake binutils-dev libcurl4-openssl-dev libiberty-dev libelf-dev libdw-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y;
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '14.4.0'
- name: Install yarn
run: |
npm install -g yarn
- name: Build Ledger app
run: |
make build_full_parser_s
make clean
make build_full_parser_x
- name: Build/Install build js deps
run: |
export PATH=~/.cargo/bin:$PATH
make zemu_install
- name: Run zemu tests
run: |
export PATH=~/.cargo/bin:$PATH
make zemu_test
test_zemu_sr25519:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
- name: Install rust
run: |
sudo apt-get update
sudo apt-get install -y cmake binutils-dev libcurl4-openssl-dev libiberty-dev libelf-dev libdw-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y;
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '14.4.0'
- name: Install yarn
run: |
npm install -g yarn
- name: Build Ledger app
run: |
make build_sr25519
- name: Build/Install build js deps
run: |
export PATH=~/.cargo/bin:$PATH
make zemu_install
- name: Run zemu tests for sr25519
run: |
export PATH=~/.cargo/bin:$PATH
cd tests_zemu && yarn testSR25519
Loading

0 comments on commit 223ff6b

Please sign in to comment.