Skip to content

Commit

Permalink
Adding build with the runtime to CI build matrix (#153)
Browse files Browse the repository at this point in the history
Adding build with the runtime to CI build matrix

- build on macos-latest without runtime
- build on ubuntu-latest with runtime
- added build dependency installation for Ubuntu (clang++-17)
- disabled linting for build with runtime until all errors are resolved

Closes: #141
  • Loading branch information
vmilosevic authored Jul 18, 2024
1 parent 32f4863 commit a7d4923
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 9 deletions.
File renamed without changes.
28 changes: 28 additions & 0 deletions .github/actions/install-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Install build dependencies"
description: "Installs build dependencies on GitHub Actions runners"

inputs:
os:
description: 'Runner OS'
required: true

runs:
using: "composite"
steps:
- name: Retrieve and install pkg deps based on OS
if: startsWith(inputs.os, 'ubuntu')
id: retrieve-pkg-deps
shell: bash
run: |
DEPENDENCIES=$(jq -r --arg os "${{ inputs.os }}" '.[$os] | .[]' $GITHUB_ACTION_PATH/dependencies.json)
echo $DEPENDENCIES
sudo apt update
sudo apt install -y $DEPENDENCIES
- name: Install Clang-17
if: startsWith(inputs.os, 'ubuntu')
shell: bash
run: |
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 17
sudo apt install -y libc++-17-dev libc++abi-17-dev
23 changes: 23 additions & 0 deletions .github/actions/install-deps/dependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"ubuntu-20.04": [
"libnuma-dev",
"libyaml-cpp-dev",
"libhwloc-dev",
"libgtest-dev",
"libboost-dev"
],
"ubuntu-22.04": [
"libnuma-dev",
"libyaml-cpp-dev",
"libhwloc-dev",
"libgtest-dev",
"libboost-dev"
],
"ubuntu-latest": [
"libnuma-dev",
"libyaml-cpp-dev",
"libhwloc-dev",
"libgtest-dev",
"libboost-dev"
]
}
25 changes: 16 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,29 @@ jobs:
fail-fast: false

matrix:
os: [macos-latest]
os: [ubuntu-20.04, macos-latest]
c_compiler: [clang]
cpp_compiler: [clang++]
build_type: [Release]

include:
#- os: ubuntu-latest
# c_compiler: clang
# cpp_compiler: clang++
# build_type: Release
- os: ubuntu-20.04
enable_runtime: ON
- os: macos-latest
c_compiler: clang
cpp_compiler: clang++
build_type: Release
enable_runtime: OFF

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history and tags

- name: Install build dependencies
uses: ./.github/actions/install-deps
with:
os: ${{ matrix.os }}

- name: Build and cache ttmlir-toolchain
uses: ./.github/actions/build_toolchain
uses: ./.github/actions/build-toolchain
with:
os: ${{ matrix.os }}

Expand All @@ -57,6 +61,8 @@ jobs:
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DTTMLIR_ENABLE_RUNTIME=${{ matrix.enable_runtime }} \
-DTTMLIR_ENABLE_RUNTIME_TESTS=${{ matrix.enable_runtime }} \
-S ${{ github.workspace }}
- name: Build
Expand All @@ -66,6 +72,7 @@ jobs:
cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Lint
if: matrix.enable_runtime == 'OFF'
shell: bash
run: |
source env/activate
Expand Down

0 comments on commit a7d4923

Please sign in to comment.