Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update actions #83

Merged
merged 1 commit into from
Mar 17, 2023
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
28 changes: 12 additions & 16 deletions .github/workflows/check_version.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: "Verify PRs to main"
name: Verify PRs to main

on:
workflow_dispatch:
pull_request:
paths:
- app/**
- deps/**
branches:
- main
- develop

jobs:
configure:
Expand All @@ -12,33 +17,24 @@ jobs:
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
steps:
- id: get-user
run: echo "::set-output name=uid_gid::$(id -u):$(id -g)"
run: echo "uid_gid=$(id -u):$(id -g)" >> $GITHUB_OUTPUT

get_version:
needs: configure
runs-on: ubuntu-latest
container:
image: zondax/builder-bolos:latest
image: zondax/ledger-app-builder:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_ENV: /opt/bolos
HOME: /home/zondax_circle
outputs:
version: ${{ steps.store-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: true

- name: Invoke `version`
shell: bash -l {0}
env:
BOLOS_SDK: ${{ github.workspace }}/deps/nanos-secure-sdk
run: make version

- run: make version
- id: store-version
run: echo ::set-output name=version::$(cat ./app/app.version)
run: echo "version=$(cat ./app/app.version)" >> $GITHUB_OUTPUT

check_app_version:
needs: get_version
Expand All @@ -55,4 +51,4 @@ jobs:

- name: Tag exists
if: ${{ steps.checkTag.outputs.exists == 'true' }}
run: exit 1
run: exit 1
2 changes: 1 addition & 1 deletion .github/workflows/ledger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true

Expand Down
146 changes: 49 additions & 97 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: "Test/Build"
name: Build
on:
workflow_dispatch:
push:
pull_request:
branches: [ main, develop ]
branches:
- main
- develop

jobs:
configure:
Expand All @@ -12,131 +14,91 @@ jobs:
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
steps:
- id: get-user
run: echo "::set-output name=uid_gid::$(id -u):$(id -g)"
run: echo "uid_gid=$(id -u):$(id -g)" >> $GITHUB_OUTPUT

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

build_ledger_nano_S:
build_ledger:
needs: configure
runs-on: ubuntu-latest
container:
image: zondax/builder-bolos:latest
image: zondax/ledger-app-builder:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: ${{ github.workspace }}/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

build_ledger_nano_X:
needs: configure
runs-on: ubuntu-latest
container:
image: zondax/builder-bolos:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: ${{ github.workspace }}/deps/nanox-secure-sdk
BOLOS_ENV: /opt/bolos
HOME: /home/zondax_circle
env:
BOLOS_SDK: /opt/nanos-secure-sdk
outputs:
size: ${{steps.build.outputs.size}}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: true
- name: Build Standard app
id: build
shell: bash -l {0}
run: |
source $HOME/.cargo/env
make
echo "size=$(python3 deps/ledger-zxlib/scripts/getSize.py s)" >> $GITHUB_OUTPUT

build_ledger_nano_SP:
needs: configure
size_nano_s:
needs: build_ledger
runs-on: ubuntu-latest
container:
image: zondax/builder-bolos:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: ${{ github.workspace }}/deps/nanosplus-secure-sdk
BOLOS_ENV: /opt/bolos
HOME: /home/zondax_circle
NANOS_LIMIT_SIZE: 136
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Build Standard app
shell: bash -l {0}
run: |
source $HOME/.cargo/env
make
- run: |
echo "LNS app size: ${{needs.build_ledger.outputs.size}} KiB"
[ ${{needs.build_ledger.outputs.size}} -le $NANOS_LIMIT_SIZE ]

test_zemu:
runs-on: ubuntu-latest
steps:
- name: Test
run: |
id
echo $HOME
echo $DISPLAY
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
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
uses: actions-rs/toolchain@v1
with:
node-version: '14.17.0'
toolchain: stable
- name: Install node
uses: actions/setup-node@v3
- name: Install yarn
run: |
npm install -g yarn
- name: Build Ledger app
run: |
make
- name: Build/Install build js deps
- name: Build and run zemu tests
run: |
export PATH=~/.cargo/bin:$PATH
make zemu_install
- name: Run zemu tests
run: |
export PATH=~/.cargo/bin:$PATH
make zemu_test
make test_all

build_package_nanos:
needs: [ configure, build, build_ledger_nano_S, build_ledger_nano_X, build_ledger_nano_SP, test_zemu ]
needs: [configure, build, build_ledger, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
image: zondax/builder-bolos:latest
image: zondax/ledger-app-builder:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: ${{ github.workspace }}/deps/nanos-secure-sdk
BOLOS_ENV: /opt/bolos
HOME: /home/zondax_circle
BOLOS_SDK: /opt/nanos-secure-sdk
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: true
- name: Install deps
Expand All @@ -145,17 +107,13 @@ jobs:
- name: Build NanoS
shell: bash -l {0}
run: |
source $HOME/.cargo/env
make
mv ./app/pkg/installer_s.sh ./app/pkg/installer_nanos.sh

- name: Set tag
id: nanos
run: |
pip install ledgerblue
echo ::set-output name=tag_name::$(./app/pkg/installer_nanos.sh version)
- name: Create Release
id: create_release
run: echo "tag_name=$(./app/pkg/installer_nanos.sh version)" >> $GITHUB_OUTPUT
- name: Create or Update Release (1)
id: create_release_0
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
Expand All @@ -165,20 +123,18 @@ jobs:
draft: false
prerelease: false

build_package_nanos_plus:
needs: [ configure, build, build_ledger_nano_S, build_ledger_nano_X, build_ledger_nano_SP, test_zemu ]
build_package_nanosp:
needs: [configure, build, build_ledger, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
image: zondax/builder-bolos:latest
image: zondax/ledger-app-builder:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: ${{ github.workspace }}/deps/nanosplus-secure-sdk
BOLOS_ENV: /opt/bolos
HOME: /home/zondax_circle
env:
BOLOS_SDK: /opt/nanosplus-secure-sdk
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: true
- name: Install deps
Expand All @@ -187,17 +143,13 @@ jobs:
- name: Build NanoSP
shell: bash -l {0}
run: |
source $HOME/.cargo/env
make
mv ./app/pkg/installer_s2.sh ./app/pkg/installer_nanos_plus.sh

- name: Set tag
id: nanosp
run: |
pip install ledgerblue
echo ::set-output name=tag_name::$(./app/pkg/installer_nanos_plus.sh version)
run: echo "tag_name=$(./app/pkg/installer_nanos_plus.sh version)" >> $GITHUB_OUTPUT
- name: Update Release
id: update_release
id: update_release_2
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
Expand Down