Skip to content

Commit

Permalink
Merge pull request #58 from LedgerHQ/develop
Browse files Browse the repository at this point in the history
Align master with P1 version
  • Loading branch information
fbeutin-ledger authored Feb 14, 2023
2 parents 3b5dfd7 + bc5e535 commit 4cd0e65
Show file tree
Hide file tree
Showing 120 changed files with 6,259 additions and 5,122 deletions.
81 changes: 49 additions & 32 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,69 +7,86 @@ on:
- master
- develop
pull_request:
branches:
- master
- develop

jobs:
job_nanoS_build_debug:
name: Build debug app for NanoS
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
steps:
- name: Clone
uses: actions/checkout@v2
- name: Build
run: |
make DEBUG=1
- name: Upload app binary
uses: actions/upload-artifact@v2
with:
name: app-nanoS-debug
path: bin
build_application:
strategy:
matrix:
sdk:
- path: $NANOS_SDK
name: nanos
- path: $NANOX_SDK
name: nanox
- path: $NANOSP_SDK
name: nanosp

job_nanoX_build_debug:
name: Build debug app for NanoX
runs-on: ubuntu-latest

container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest

steps:
- name: Clone
uses: actions/checkout@v2
- name: Build
uses: actions/checkout@v3

- name: Build application
run: |
make DEBUG=1 BOLOS_SDK=$NANOX_SDK
- name: Upload app binary
uses: actions/upload-artifact@v2
make BOLOS_SDK=${{ matrix.sdk.path }} DEBUG=1
cp bin/app.elf bin/solana_${{ matrix.sdk.name }}.elf
- name: Upload application binaries
uses: actions/upload-artifact@v3
with:
name: app-nanoX-debug
path: bin
name: solana_binaries
path: ./bin/solana_${{ matrix.sdk.name }}.elf
if-no-files-found: error

job_scan_build:
name: Clang Static Analyzer
needs: build_application
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build with Clang Static Analyzer
run: |
make clean
scan-build --use-cc=clang -analyze-headers -enable-checker security -enable-checker unix -enable-checker valist -o scan-build --status-bugs make default
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: failure()
with:
name: scan-build
path: scan-build

python_tests_nano:
name: NanoS Ragger tests
needs: build_application
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v3
- name: Download all binaries
uses: actions/download-artifact@v3
- name: Gather artifacts
run: |
mkdir tests/elfs
mv *_binaries/*.elf tests/elfs
- name: Install APT dependencies
run: sudo apt-get update && sudo apt-get install -y qemu-user-static
- name: Install Ragger
run: |
pip install --extra-index-url https://test.pypi.org/simple/ -r tests/python/requirements.txt
- name: Run tests
run: pytest tests/python/ -v --tb=short --device all

job_C_test:
name: C tests
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest
steps:
- name: Clone
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Build unit tests
run: make -C libsol
48 changes: 48 additions & 0 deletions .github/workflows/lint-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Code style check

on:
workflow_dispatch:
push:
branches:
- master
- develop
pull_request:

jobs:
job_lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Clone
uses: actions/checkout@v3

- name: Lint src
uses: DoozyX/[email protected]
with:
source: './src'
extensions: 'h,c'
clangFormatVersion: 12.0.0

- name: Lint libsol
uses: DoozyX/[email protected]
with:
source: './libsol'
extensions: 'h,c'
clangFormatVersion: 12.0.0

misspell:
name: Check misspellings
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check misspellings
uses: codespell-project/actions-codespell@2391250ab05295bddd51e36a8c6295edb6343b0e
with:
# Use Config file when the github action supports it
builtin: clear,rare
check_filenames: true
skip: ./libsol,./tests
11 changes: 4 additions & 7 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,19 @@ on:
- master
- develop
pull_request:
branches:
- master
- develop
types: [opened, synchronize, reopened]

jobs:
build:
name: SonarQube analyze
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest
env:
SONAR_SCANNER_VERSION: 4.7.0.2747
SONAR_SERVER_URL: "https://sonarcloud.io"
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
Expand All @@ -35,8 +31,9 @@ jobs:
run: |
apt-get update -y
apt-get upgrade -y
DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
curl -sL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y gcovr nodejs unzip
apt-get install -y gcovr nodejs unzip lcov
mkdir -p $HOME/.sonar
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ src/glyphs.h
gitignore
.vagrant
libsol/target

# Python
__pycache__
.egg
.pyc
*~

tests/elfs/
tests/python/snapshots-tmp/
Loading

0 comments on commit 4cd0e65

Please sign in to comment.