Skip to content

[internal] Build C++ binaries with all configs impl #320

[internal] Build C++ binaries with all configs impl

[internal] Build C++ binaries with all configs impl #320

Workflow file for this run

name: "[post-commit] Build C++ binaries with all configs"
on:
workflow_dispatch:
workflow_call:
jobs:
build-lib:
strategy:
matrix:
config: [
{ type: Debug, runs-on: ubuntu-20.04 },
{ type: Release, runs-on: ubuntu-20.04 },
{ type: RelWithDebInfo, runs-on: build },
]
arch: [grayskull, wormhole_b0]
os: [ubuntu-20.04]
env:
ARCH_NAME: ${{ matrix.arch }}
CONFIG: ${{ matrix.config.type }}
# So we can get all the makefile output we want
VERBOSE: 1
runs-on: ${{ matrix.config.runs-on }}
name: cmake build ${{ matrix.config.type }} ${{ matrix.arch }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
lfs: false
- uses: ./.github/actions/install-metal-deps
with:
os: ubuntu-20.04
- uses: ./.github/actions/install-metal-dev-deps
with:
os: ubuntu-20.04
- name: Set up dynamic env vars for build
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
- name: Build tt-metal libraries
run: |
cmake -B build -G Ninja
cmake --build build
- name: Remove unnecessary artifacts
run: |
find build/ -name *.so -or -name *.a -or -name *.o | xargs strip -d
- name: 'Tar files'
run: tar -cvf ttm_${{ matrix.arch }}-${{ matrix.config.type}}.tar build
- name: Upload libraries as artifacts
uses: actions/upload-artifact@v4
with:
name: metal-build-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.config.type }}
path: ttm_${{ matrix.arch }}-${{ matrix.config.type}}.tar
build-cpptest:
strategy:
matrix:
config: [Debug, Release, RelWithDebInfo]
arch: [grayskull, wormhole_b0]
os: [ubuntu-20.04]
fail-fast: false
needs: build-lib
name: cmake build cpptest ${{ matrix.config }} ${{ matrix.arch }}
env:
ARCH_NAME: ${{ matrix.arch }}
CONFIG: ${{ matrix.config }}
# So we can get all the makefile output we want
VERBOSE: 1
runs-on: build
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
lfs: false
- name: Set up dynamic env vars for build
run: |
echo "TT_METAL_HOME=$(pwd)" >> $GITHUB_ENV
- uses: actions/download-artifact@v4
with:
name: metal-build-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.config }}
- name: Extract files
run: tar -xvf ttm_${{ matrix.arch }}-${{ matrix.config}}.tar
- name: Build tt-metal tests
run: |
rm -f build/CMakeCache.txt && find build -name 'cmake_pch.hxx.pch' -exec touch {} \;
cmake -B build -G Ninja
cmake --build build --target tests