[Rust/Greenfield]: Move BNB Greenfield to Rust (#3597) #5834
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: Linux CI | |
on: | |
push: | |
branches: [ dev, master ] | |
pull_request: | |
branches: [ dev, master ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
# Work around https://github.com/actions/runner-images/issues/8659 | |
- name: Remove GCC 13 from runner image | |
shell: bash | |
run: | | |
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list | |
sudo apt-get update | |
sudo apt-get install -y --allow-downgrades libc6=2.35-0ubuntu3.5 libc6-dev=2.35-0ubuntu3.5 libstdc++6=12.3.0-1ubuntu1~22.04 libgcc-s1=12.3.0-1ubuntu1~22.04 | |
- uses: actions/checkout@v3 | |
- name: Install system dependencies | |
run: | | |
tools/install-sys-dependencies-linux | |
tools/install-rust-dependencies | |
- name: Cache internal dependencies | |
id: internal_cache | |
uses: actions/cache@v3 | |
with: | |
path: build/local | |
key: ${{ runner.os }}-internal-${{ hashFiles('tools/install-dependencies') }} | |
- name: Install internal dependencies | |
run: | | |
tools/install-dependencies | |
env: | |
CC: /usr/bin/clang | |
CXX: /usr/bin/clang++ | |
if: steps.internal_cache.outputs.cache-hit != 'true' | |
- name: Cache Rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: | | |
rust | |
- name: Code generation | |
run: | | |
tools/generate-files native | |
env: | |
CC: /usr/bin/clang | |
CXX: /usr/bin/clang++ | |
- name: CMake (coverage/clang-tidy/clang-asan) | |
run: | | |
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DTW_UNITY_BUILD=ON -DTW_CODE_COVERAGE=ON -DTW_ENABLE_CLANG_TIDY=ON -DTW_CLANG_ASAN=ON -GNinja | |
env: | |
CC: /usr/bin/clang | |
CXX: /usr/bin/clang++ | |
- name: Build and test | |
run: | | |
ninja -Cbuild tests TrezorCryptoTests | |
build/trezor-crypto/crypto/tests/TrezorCryptoTests | |
build/tests/tests --gtest_output=xml | |
env: | |
CC: /usr/bin/clang | |
CXX: /usr/bin/clang++ | |
CK_TIMEOUT_MULTIPLIER: 4 | |
- name: Gather and check code coverage | |
run: | | |
sudo rm -rf coverage.info | |
tools/coverage |