CI #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
- develop | |
pull_request: | |
branches: | |
- master | |
- develop | |
jobs: | |
job_build: | |
name: Compilation | |
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=0 COIN=avian && mv bin/ avian-bin/ | |
make clean | |
make DEBUG=0 COIN=avian_testnet && mv bin/ avian-testnet-bin/ | |
- name: Upload Avian app binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: avian-app | |
path: avian-bin | |
- name: Upload Avian Testnet app binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: avian-testnet-app | |
path: avian-testnet-bin | |
job_unit_test: | |
name: Unit test | |
needs: job_build | |
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: | | |
cd unit-tests/ | |
cmake -Bbuild -H. && make -C build && make -C build test | |
- name: Generate code coverage | |
run: | | |
cd unit-tests/ | |
lcov --directory . -b "$(realpath build/)" --capture --initial -o coverage.base && \ | |
lcov --rc lcov_branch_coverage=1 --directory . -b "$(realpath build/)" --capture -o coverage.capture && \ | |
lcov --directory . -b "$(realpath build/)" --add-tracefile coverage.base --add-tracefile coverage.capture -o coverage.info && \ | |
lcov --directory . -b "$(realpath build/)" --remove coverage.info '*/unit-tests/*' -o coverage.info && \ | |
genhtml coverage.info -o coverage | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: code-coverage | |
path: unit-tests/coverage | |
- name: HTML documentation | |
run: doxygen .doxygen/Doxyfile | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: documentation | |
path: doc/html | |
job_test_legacy_native: | |
name: Legacy tests | |
needs: job_build | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/ledgerhq/app-bitcoin-new/speculos-bitcoin:latest | |
ports: | |
- 1234:1234 | |
- 9999:9999 | |
- 40000:40000 | |
- 41000:41000 | |
- 42000:42000 | |
- 43000:43000 | |
options: --entrypoint /bin/bash | |
steps: | |
- name: Clone | |
uses: actions/checkout@v2 | |
- name: Download Bitcoin Testnet app binary | |
uses: actions/download-artifact@v2 | |
with: | |
name: avian-testnet-app | |
path: tests-legacy/avian-testnet-bin | |
- name: Run tests | |
run: | | |
cd tests-legacy | |
pip install -r requirements.txt | |
PATH=$PATH:/speculos pytest |