CI: Make a wheel #134
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
name: CI | |
on: | |
push: | |
branches: ["**"] # For now, let's build all branches. Roll this back if it gets too slow or we exhaust our quota. | |
pull_request: | |
branches: ["**"] # * does not match '/' | |
workflow_dispatch: # For manually triggering a build: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_dispatch | |
jobs: | |
build: | |
strategy: | |
matrix: | |
# We mainly care about hardware rather than OS | |
# macos-13 is x86 | |
# macos-latest is arm64 | |
# ubuntu-latest is x64 | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
# Build (and test) Lean. Tests are all via #guard macros | |
# now so you can't really build without testing. | |
- uses: leanprover/lean-action@v1 | |
- name: Run tests | |
run: lake exe klr | |
# Run pytest | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
cache: 'pip' | |
- name: Install dependencies | |
working-directory: ./interop | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run pytest | |
working-directory: ./interop | |
run: | | |
pytest | |
- name: Make a wheel | |
# https://github.com/pypa/cibuildwheel | |
# Hit this: https://github.com/pypa/cibuildwheel/discussions/1926 | |
env: | |
# https://github.com/leanprover/lean4/pull/6631/files | |
MACOSX_DEPLOYMENT_TARGET: 99.0 | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_SKIP: pp* # The build doesn't work on pypy: auditwheel: error: cannot repair "/tmp/cibuildwheel/built_wheel/klr-0.0.3-cp38-cp38-linux_i686.whl" to "manylinux2014_i686" ABI because of the presence of too-recent versioned symbols. You'll need to compile the wheel on an older toolchain. | |
run: | | |
pip install cibuildwheel | |
bin/make-wheel | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./.wheel/wheelhouse/*.whl |