Refactor our CI yamls #3
Workflow file for this run
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 | |
timeout-minutes: ${{ fromJSON(inputs.timeout) }} | |
strategy: | |
fail-fast: false | |
matrix: | |
build: [ | |
{runs-on: ubuntu-22.04, docker-image: tt-umd-ci-ubuntu-22.04}, | |
{runs-on: ubuntu-20.04, docker-image: tt-umd-ci-ubuntu-20.04}, | |
] | |
name: Build device for any arch on ${{ matrix.build.runs-on }} | |
runs-on: ${{ matrix.build.runs-on }} | |
container: | |
image: ghcr.io/${{ github.repository }}/${{ matrix.build.docker-image }}:latest | |
options: --user root | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
lfs: 'true' | |
- 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." |