From e66c75ac6ba117989ba99a124b46943064d0d171 Mon Sep 17 00:00:00 2001 From: Lucas PASCAL Date: Fri, 25 Mar 2022 09:51:20 +0100 Subject: [PATCH] [add] Building the app + running the C tests --- .clang-format | 20 +++++++++ .github/workflows/ci-workflow.yml | 75 +++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 .clang-format create mode 100644 .github/workflows/ci-workflow.yml diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..b4abfa06 --- /dev/null +++ b/.clang-format @@ -0,0 +1,20 @@ +--- +BasedOnStyle: Google +IndentWidth: 4 +--- +Language: Cpp +ColumnLimit: 100 +PointerAlignment: Right +AlignAfterOpenBracket: Align +AlignConsecutiveMacros: true +AllowAllParametersOfDeclarationOnNextLine: false +SortIncludes: false +SpaceAfterCStyleCast: true +AllowShortCaseLabelsOnASingleLine: false +AllowAllArgumentsOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: Never +AllowShortFunctionsOnASingleLine: None +BinPackArguments: false +BinPackParameters: false +--- diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml new file mode 100644 index 00000000..4893ad2e --- /dev/null +++ b/.github/workflows/ci-workflow.yml @@ -0,0 +1,75 @@ +name: Compilation & tests + +on: + workflow_dispatch: + push: + branches: + - 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 + + 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 + run: | + make DEBUG=1 BOLOS_SDK=$NANOX_SDK + - name: Upload app binary + uses: actions/upload-artifact@v2 + with: + name: app-nanoX-debug + path: bin + + job_scan_build: + name: Clang Static Analyzer + runs-on: ubuntu-latest + container: + image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest + steps: + - uses: actions/checkout@v2 + - 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 + if: failure() + with: + name: scan-build + path: scan-build + + job_C_test: + name: C tests + 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 unit tests + run: make -C libsol