Skip to content

Commit

Permalink
Add macos and windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Nov 11, 2024
1 parent 023cf93 commit 654ce9f
Showing 1 changed file with 57 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: CI - manylinux x86_64 clang LLVM
name: "Build LLVM and MLIR"

on:
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/ci_manylinux_x86_64_clang_llvm.yml"
- ".github/workflows/build_llvm.yml"
- "third_party/llvm-project"

concurrency:
Expand All @@ -16,18 +16,37 @@ concurrency:
cancel-in-progress: true

jobs:
manylinux_x64_clang_llvm:
name: Build LLVM and MLIR

runs-on: ubuntu-22.04
build:

strategy:
fail-fast: false
matrix:
include:
- name: "manylinux_x86_64"
runs-on: "ubuntu-22.04"
container: "quay.io/pypa/manylinux_2_28_x86_64"
- name: "windows_x86_64"
runs-on: "windows-2019"
- name: "macos_arm64"
runs-on: "macos-latest"
# - name: "macos_x86_64"
# os: "macos-13"

runs-on: ${{ matrix.runs-on }}

name: ${{ matrix.name }}

defaults:
run:
shell: bash

env:
CACHE_DIR: /.container-cache
# either the PR number or `branch-N` where N always increments
CACHE_KEY: manylinux_x64_clang_llvm_${{ format('{0}-{1}', github.ref_name, github.run_number) }}
CACHE_KEY: ${{ matrix.name }}_x64_clang_llvm_${{ format('{0}-{1}', github.ref_name, github.run_number) }}

container:
image: quay.io/pypa/manylinux_2_28_x86_64
image: ${{ matrix.container }}

steps:

Expand All @@ -44,29 +63,56 @@ jobs:
with:
path: ${{ env.CACHE_DIR }}
key: ${{ env.CACHE_KEY }}
restore-keys: manylinux_x64_clang_llvm_
restore-keys: ${{ matrix.name }}_x64_clang_llvm

- name: "Check out repository"
uses: actions/[email protected]
with:
submodules: true

- name: "Install OS deps"
if: ${{ matrix.name == 'manylinux_x86_64' }}
run: |
dnf install -y epel-release
dnf install -y sudo ncurses-compat-libs tmate python3-pip
- name: "Install OS deps"
if: ${{ startsWith(matrix.runs-on, 'macos') }}
run: |
brew install ccache ninja
- name: "Install Python"
uses: actions/setup-python@v4
if: ${{ startsWith(matrix.runs-on, 'macos') || startsWith(matrix.runs-on, 'windows') }}
with:
python-version: '3.12'

- name: "Setup compiler/toolchain"
uses: aminya/setup-cpp@v1
if: ${{ startsWith(matrix.runs-on, 'ubuntu') || startsWith(matrix.runs-on, 'windows') }}
with:
compiler: llvm-18
cmake: true
ninja: true
ccache: true

- name: "Fix CC/CXX on Windows"
if: ${{ startsWith(matrix.runs-on, 'windows') }}
run: |
echo "CC=/C/Users/runneradmin/llvm/bin/clang-cl.exe" >> $GITHUB_ENV
echo "CXX=/C/Users/runneradmin/llvm/bin/clang-cl.exe" >> $GITHUB_ENV
- name: "Python deps"
run: |
python3.12 -m pip install -r third_party/llvm-project/mlir/python/requirements.txt
python3_command=""
if (command -v python3.12 &> /dev/null); then
python3_command="python3.12"
elif (command -v python3 &> /dev/null); then
python3_command="python3"
elif (command -v python &> /dev/null); then
python3_command="python"
fi
$python3_command -m pip install -r third_party/llvm-project/mlir/python/requirements.txt
- name: "Build LLVM and MLIR"
run: |
Expand All @@ -77,8 +123,6 @@ jobs:
export CMAKE_C_COMPILER_LAUNCHER=ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
export CMAKE_C_COMPILER=clang
export CMAKE_CXX_COMPILER=clang++
export CMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld"
export CMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld"
export CMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld"
Expand Down Expand Up @@ -115,4 +159,4 @@ jobs:
uses: mxschmitt/[email protected]
with:
limit-access-to-actor: true
install-dependencies: false
install-dependencies: ${{ startsWith(matrix.runs-on, 'macos') || startsWith(matrix.runs-on, 'windows') }}

0 comments on commit 654ce9f

Please sign in to comment.