Skip to content

Commit

Permalink
Improvements and update CI (#149)
Browse files Browse the repository at this point in the history
* update submodules

update tests and make them concurrent

compile rust first

fix typo

update dep

* bump app version, update snapshots and fix_ci

* removed no used build version for installers
  • Loading branch information
neithanmo committed Mar 15, 2023
1 parent 9120242 commit 3b24417
Show file tree
Hide file tree
Showing 22 changed files with 117 additions and 185 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/check_version.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "Verify PRs to main"

on:
workflow_dispatch:
pull_request:
branches:
- main
Expand All @@ -12,33 +13,26 @@ 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
SDK_VARNAME: NANOSP_SDK
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 @@ -56,3 +50,4 @@ jobs:
- name: Tag exists
if: ${{ steps.checkTag.outputs.exists == 'true' }}
run: exit 1

38 changes: 15 additions & 23 deletions .github/workflows/ledger.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,41 @@

name: CI

on:
# Triggers the workflow on push or pull request events but only for the master branch
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- master
- main
- develop
pull_request:
branches:
- master
- main
- develop

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

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)"

scan-build:
needs: configure
runs-on: ubuntu-latest
name: Clang Static Analyzer
runs-on: ubuntu-latest

container:
image: zondax/ledger-app-builder:latest
options: --user ${{ needs.configure.outputs.uid_gid }}
env:
BOLOS_SDK: /opt/nanos-secure-sdk
outputs:
size: ${{steps.build.outputs.size}}
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true

- name: Build with Clang Static Analyzer
- name: Build Standard app
id: build
shell: bash -l {0}
run: |
# we need to install clang-tools which
# contains the scan-build tool which is a static
# analyzer use to scan C code.
sudo apt-get -qy install clang-tools
scan-build --use-cc=clang -analyze-headers -enable-checker security -enable-checker unix -enable-checker valist -o scan-build --status-bugs make all
- uses: actions/upload-artifact@v2
scan-build --use-cc=clang -analyze-headers -enable-checker security -enable-checker unix -enable-checker valist -o scan-build --status-bugs make
if: failure()
with:
name: scan-build
Expand Down
Loading

0 comments on commit 3b24417

Please sign in to comment.