Handle Blackhole board types #345
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
# Builds device. | |
# Build is performed on all supported OS versions. | |
name: Build Device | |
on: | |
workflow_dispatch: | |
inputs: | |
timeout: | |
required: true | |
description: 'The timeout for the job in minutes' | |
type: number | |
default: 15 | |
pull_request: | |
branches: ["main"] | |
push: | |
branches: ["main"] | |
env: | |
BUILD_TARGET: device | |
BUILD_OUTPUT_DIR: ./build | |
LIB_OUTPUT_DIR: ./build/lib | |
DEPS_OUTPUT_DIR: ./build/_deps | |
TEST_OUTPUT_DIR: ./build/test | |
CREATE_MAP_BINARIES_DIR: ./device/bin/silicon | |
jobs: | |
build: | |
# Due to parsing bug, fromJSON is used to convert string to number. | |
# In pull_request or push events, the input context is not available, stating the default again here. | |
timeout-minutes: ${{ fromJSON(inputs.timeout || '15') }} | |
strategy: | |
fail-fast: false | |
matrix: | |
image: [ | |
{runs-on: ubuntu-20.04, docker-image: tt-umd-ci-ubuntu-20.04, compiler: clang}, | |
{runs-on: ubuntu-20.04, docker-image: tt-umd-ci-ubuntu-20.04, | |
compiler: gcc, c: /usr/bin/gcc, cpp: /usr/bin/g++}, | |
{runs-on: ubuntu-22.04, docker-image: tt-umd-ci-ubuntu-22.04, compiler: clang}, | |
{runs-on: ubuntu-22.04, docker-image: tt-umd-ci-ubuntu-22.04, | |
compiler: gcc-12, c: /usr/bin/gcc-12, cpp: /usr/bin/g++-12}, | |
] | |
name: Build device for any arch on ${{ matrix.image.runs-on }} with ${{ matrix.image.compiler }} | |
runs-on: ${{ matrix.image.runs-on }} | |
container: | |
image: ghcr.io/${{ github.repository }}/${{ matrix.image.docker-image }}:latest | |
options: --user root | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set GCC compiler | |
# In case clang is selected, don't set these variables, cmake will find it by default. | |
if: ${{ matrix.image.compiler != 'clang' }} | |
run: | | |
echo "CMAKE_C_COMPILER=${{ matrix.image.c }}" >> $GITHUB_ENV | |
echo "CMAKE_CXX_COMPILER=${{ matrix.image.cpp }}" >> $GITHUB_ENV | |
- name: Build ${{ env.BUILD_TARGET }} | |
run: | | |
echo "Compiling the code..." | |
cmake -B ${{ env.BUILD_OUTPUT_DIR }} -G Ninja | |
cmake --build ${{ env.BUILD_OUTPUT_DIR }} --target ${{ env.BUILD_TARGET }} | |
echo "Compile complete." |