Skip to content

BLD: Initial linux wheel build setup #74

BLD: Initial linux wheel build setup

BLD: Initial linux wheel build setup #74

Workflow file for this run

name: Wheel
on:
pull_request:
branches:
- main # NOTE: to remove
push:
branches:
- main # NOTE: to remove
schedule:
# At 09:00 on Monday. (see https://crontab.guru)
- cron: '0 9 * * 1'
defaults:
run:
shell: bash -leo pipefail {0}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-wheel:
strategy:
matrix:
os: ['ubuntu-24.04'] # , 'macos-12', 'macos-14' # TODO: 'windows-2022'
arch: ['x86_64', 'aarch64']
python: ['3.10']
exclude:
- os: 'ubuntu-24.04' # TODO: needs qemu setup
arch: 'aarch64'
- os: 'macos-12'
arch: 'aarch64'
- os: 'macos-14'
arch: 'x86_64'
- os: 'windows-2022'
arch: 'aarch64'
runs-on: ${{ matrix.os }}
env:
LLVM_SOURCE_DIR: ${{ github.workspace }}/llvm-project
FINCH_MLIR_SOURCE_DIR: ${{ github.workspace }}/Finch-mlir
steps:
- name: Checkout Finch-mlir
uses: actions/checkout@v4
with:
path: 'Finch-mlir'
- name: Checkout LLVM
uses: actions/checkout@v4
with:
repository: llvm/llvm-project
ref: '4091bc61e315f187829dca877dd908a07ba9cb91' # Latest commit as of 2024-10-17
path: 'llvm-project'
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.python }}
max-size: "1G"
verbose: 2
variant: ccache
- name: Configure ccache - ubuntu & macos
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')
shell: bash
run: |
if [ x"${{ contains(matrix.os, 'macos') }}" == x"true" ]; then
echo "/usr/local/opt/ccache/libexec:/opt/homebrew/opt/ccache/libexec" >> $GITHUB_PATH
else
echo "/usr/lib/ccache:/usr/lib64/ccache:/usr/lib/ccache/bin" >> $GITHUB_PATH
fi
# - name: Configure ccache
# shell: bash
# run: |
# ccache -p
# ccache -z
# # See https://github.com/hendrikmuhs/ccache-action/issues/146
# ccache --set-config=compiler_check=content
# ccache --set-config=sloppiness=locale,time_macros
- name: pip install standard tools
shell: bash
run: pip install cibuildwheel wheel
- name: Set env variables
run: |
echo "HOST_CCACHE_DIR="$(ccache --get-config cache_dir)"" >> $GITHUB_ENV
- name: set env variables - macos
if: contains(matrix.os, 'macos')
shell: bash
run: |
echo "MACOSX_DEPLOYMENT_TARGET=11.0" | tee -a $GITHUB_ENV
- name: cibuildwheel run
run: |
mv ./Finch-mlir/setup.py .
mv ./Finch-mlir/pyproject.toml .
cibuildwheel --output-dir ./wheelhouse
- name: Download cache from container ubuntu
if: (matrix.os == 'ubuntu-24.04' && matrix.arch == 'x86_64') && (success() || failure())
run: |
ccache -s
# rm -rf $HOST_CCACHE_DIR
# mv ./wheelhouse/.ccache $HOST_CCACHE_DIR
ls -la $HOST_CCACHE_DIR
ccache -s
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl
name: artifact_finch_mlir-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.python }}
release-wheel:
runs-on: 'ubuntu-latest'
needs: build-wheel
permissions:
id-token: write
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: artifact_finch_mlir-*
path: wheelhouse
merge-multiple: true
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: 'wheelhouse/*.whl'
token: ${{ secrets.GITHUB_TOKEN }}
tag: latest
name: latest
body: Latest release
removeArtifacts: false
allowUpdates: true
replacesArtifacts: true
makeLatest: true
artifactErrorsFailBuild: true