-
Notifications
You must be signed in to change notification settings - Fork 8
89 lines (79 loc) · 2.56 KB
/
build-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# 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
ubuntu-version:
required: true
type: string
timeout:
required: true
type: number
workflow_dispatch:
inputs:
arch:
required: true
description: 'The architecture to build for'
type: choice
options:
- wormhole_b0
- blackhole
ubuntu-version:
required: true
description: 'The version of Ubuntu to build on'
type: choice
options:
- ubuntu-22.04
- ubuntu-20.04
timeout:
required: true
description: 'The timeout for the build job in minutes'
type: number
env:
BUILD_TARGETS: "umd_tests ubench"
BUILD_OUTPUT_DIR: ./build
LIB_OUTPUT_DIR: ./build/lib
DEPS_OUTPUT_DIR: ./build/_deps
TEST_OUTPUT_DIR: ./build/test
CLUSTER_DESCRIPTORS_DIR: ./tests/api/cluster_descriptor_examples
SOC_DESCRIPTORS_DIR: ./tests/soc_descs
jobs:
build:
# Due to parsing bug, fromJSON is used to convert string to number
timeout-minutes: ${{ fromJSON(inputs.timeout) }}
name: Build umd_tests for ${{ inputs.arch }} on ${{ inputs.ubuntu-version }}
runs-on: ${{ inputs.ubuntu-version }}
container:
image: ghcr.io/${{ github.repository }}/tt-umd-ci-${{ inputs.ubuntu-version }}:latest
options: --user root
env:
ARCH_NAME: ${{ inputs.arch }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build ${{ env.BUILD_TARGETS }}
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_TARGETS }}
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 }} \
${{ env.CLUSTER_DESCRIPTORS_DIR }} \
${{ env.SOC_DESCRIPTORS_DIR }}
- name: Upload build artifacts archive
uses: actions/upload-artifact@v4
with:
name: build-artifacts-${{ inputs.arch }}-${{ inputs.ubuntu-version }}
path: artifact.tar