mirror of
https://github.com/icicle-emu/icicle-python
synced 2026-06-21 13:53:41 +00:00
163 lines
5.0 KiB
YAML
163 lines
5.0 KiB
YAML
name: CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
windows:
|
|
# Skip building pull requests from the same repository
|
|
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
|
|
runs-on: windows-latest
|
|
env:
|
|
# Disable output buffering in an attempt to get readable errors
|
|
PYTHONUNBUFFERED: '1'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- name: Python environment
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: x86_64-pc-windows-msvc
|
|
|
|
- name: Build
|
|
shell: bash
|
|
run: |
|
|
pip install -r requirements.txt
|
|
python setup.py sdist
|
|
python setup.py bdist_wheel --py-limited-api=cp37
|
|
pip install --force-reinstall dist/*.whl
|
|
python -c "import icicle"
|
|
|
|
- name: Test
|
|
run: |
|
|
pip install -r tests/requirements.txt
|
|
python tests/example.py
|
|
python tests/invalid.py
|
|
|
|
- name: Upload wheels
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: wheels-windows
|
|
path: dist
|
|
|
|
macos:
|
|
# Skip building pull requests from the same repository
|
|
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
|
|
runs-on: macos-latest
|
|
env:
|
|
# Disable output buffering in an attempt to get readable errors
|
|
PYTHONUNBUFFERED: '1'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- name: Python environment
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: aarch64-apple-darwin, x86_64-apple-darwin
|
|
|
|
- name: Build
|
|
shell: bash
|
|
env:
|
|
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
|
|
MACOSX_DEPLOYMENT_TARGET: '10.9'
|
|
ARCHFLAGS: -arch x86_64 -arch arm64
|
|
PYO3_CROSS_LIB_DIR: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib
|
|
run: |
|
|
pip install -r requirements.txt
|
|
python setup.py bdist_wheel --py-limited-api=cp37
|
|
pip install --force-reinstall dist/*_universal2.whl
|
|
python -c "import icicle"
|
|
|
|
- name: Test
|
|
run: |
|
|
pip install -r tests/requirements.txt
|
|
python tests/example.py
|
|
python tests/invalid.py
|
|
|
|
- name: Upload wheels
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: wheels-macos
|
|
path: dist
|
|
|
|
linux:
|
|
# Skip building pull requests from the same repository
|
|
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
|
|
runs-on: ubuntu-24.04
|
|
container: quay.io/pypa/manylinux_2_28_x86_64
|
|
env:
|
|
# Disable output buffering in an attempt to get readable errors
|
|
PYTHONUNBUFFERED: '1'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- name: Build
|
|
shell: bash
|
|
run: |
|
|
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y && yum install -y openssl-devel
|
|
export PATH="$PATH:$HOME/.cargo/bin"
|
|
export PATH="/opt/python/cp38-cp38/bin:$PATH"
|
|
pip install -r requirements.txt
|
|
python setup.py bdist_wheel --py-limited-api=cp37 --plat-name manylinux_2_28_x86_64
|
|
auditwheel show dist/*.whl
|
|
pip install --force-reinstall dist/*.whl
|
|
python -c "import icicle"
|
|
|
|
- name: Test
|
|
run: |
|
|
export PATH="/opt/python/cp38-cp38/bin:$PATH"
|
|
pip install -r tests/requirements.txt
|
|
python tests/example.py
|
|
python tests/invalid.py
|
|
|
|
- name: Upload wheels
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: wheels-linux
|
|
path: dist
|
|
|
|
release:
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
runs-on: ubuntu-24.04
|
|
needs: [windows, macos, linux]
|
|
permissions:
|
|
contents: write
|
|
discussions: write
|
|
id-token: write
|
|
steps:
|
|
- name: Download wheels
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
pattern: wheels-*
|
|
merge-multiple: true
|
|
path: dist
|
|
|
|
- name: Publish to PyPI
|
|
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.13
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9
|
|
with:
|
|
generate_release_notes: true
|
|
files: dist/*
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|