Build Target #2
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 umd_tests. | |
# Build is performed on the specified architecture and on all supported OS versions. | |
name: Build Target | |
on: | |
workflow_call: | |
inputs: | |
arch: | |
required: true | |
type: string | |
timeout: | |
required: true | |
type: number | |
workflow_dispatch: | |
inputs: | |
arch: | |
required: true | |
description: 'The architecture to build for' | |
type: choice | |
options: | |
- grayskull | |
- wormhole_b0 | |
- blackhole | |
timeout: | |
required: true | |
description: 'The timeout for the build job in minutes' | |
type: number | |
env: | |
BUILD_TARGET: umd_tests | |
BUILD_OUTPUT_DIR: ./build | |
LIB_OUTPUT_DIR: ./build/lib | |
DEPS_OUTPUT_DIR: ./build/_deps | |
TEST_OUTPUT_DIR: ./build/test | |
jobs: | |
build: | |
timeout-minutes: ${{ 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 umd_tests for ${{ inputs.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 | |
env: | |
ARCH_NAME: ${{ inputs.arch }} | |
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 -DTT_UMD_BUILD_TESTS=ON | |
cmake --build ${{ env.BUILD_OUTPUT_DIR }} --target ${{ env.BUILD_TARGET }} | |
echo "Compile complete." | |
# This is needed to preserve file permissions | |
# https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss | |
- name: Tar build, test and run artifacts | |
shell: bash | |
run: | | |
tar cvf artifact.tar ${{ env.TEST_OUTPUT_DIR }} \ | |
${{ env.LIB_OUTPUT_DIR }} \ | |
${{ env.DEPS_OUTPUT_DIR }} | |
- name: Upload build artifacts archive | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifacts-${{ inputs.arch }}-${{ matrix.build.runs-on }} | |
path: artifact.tar |