Skip to content

enforce limited abi and test on multiple versions #298

enforce limited abi and test on multiple versions

enforce limited abi and test on multiple versions #298

Workflow file for this run

name: Build
on:
push:
tags:
- v*
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_wheel:
name: build-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019, ubuntu-22.04, macos-13]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
- name: Install dependencies
run: |
pip3 install wheel numpy cibuildwheel
- name: Build extension for ${{ matrix.os }}
shell: bash
if: matrix.os != 'ubuntu-22.04'
run: |
python3 -m pip wheel . -w dist
for old in dist/rocketsim-*.whl
do
new=$(echo $old | sed -E 's/-(cp[0-9]+)-cp[0-9]+-/-\1-abi3-/g')
mv $old $new
done
- name: Build extension for ${{ matrix.os }}
if: matrix.os == 'ubuntu-22.04'
run: |
python3 -m cibuildwheel --output-dir dist
for old in dist/rocketsim-*.whl
do
new=$(echo $old | sed -E 's/-(cp[0-9]+)-cp[0-9]+-.*\.whl/-\1-abi3-manylinux2014_x86_64.whl/g')
mv $old $new
done
env:
CIBW_BUILD: cp39-manylinux_x86_64
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.os }}
path: dist/rocketsim-*.whl
test_wheel:
name: test-${{ matrix.os }}-python-${{ matrix.pyversion }}
runs-on: ${{ matrix.os }}
needs: build_wheel
strategy:
matrix:
os: [windows-2019, ubuntu-22.04, macos-13]
pyversion: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyversion }}
cache: 'pip'
- name: Install dependencies
run: |
pip3 install numpy PyGLM
- name: Download artifact ${{ matrix.os }}
uses: actions/download-artifact@v4
with:
name: wheel-${{ matrix.os }}
path: dist
- name: Install extension
shell: bash
run: |
pip3 install dist/rocketsim-*.whl
- name: Load collision meshes
uses: actions/cache/restore@v4
id: collision-cache-restore
with:
path: collision_meshes
key: collision-cache
enableCrossOsArchive: true
- name: Download collision meshes
if: steps.collision-cache-restore.outputs.cache-hit != 'true'
uses: suisei-cn/actions-download-file@v1.3.0
with:
url: https://mtheall.com/~mtheall/collision_meshes.tar
- name: Extract collision meshes
if: steps.collision-cache-restore.outputs.cache-hit != 'true'
uses: a7ul/tar-action@v1.1.3
with:
command: x
files: collision_meshes.tar
- name: Save collision meshes
if: steps.collision-cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: collision_meshes
key: collision-cache
enableCrossOsArchive: true
- name: Run unit tests
run: |
python3 python-mtheall/unit_test.py
- name: Run regression tests
run: |
python3 python-mtheall/regression_test.py
publish_pypi:
name: Publish PyPI
runs-on: ubuntu-latest
needs: test_wheel
if: startsWith(github.ref, 'refs/tags/v')
environment:
name: pypi
url: https://pypi.org/p/RocketSim
permissions:
id-token: write
steps:
- name: Download artifact windows-2019
uses: actions/download-artifact@v4
with:
name: wheel-windows-2019
path: dist
- name: Download artifact ubuntu-22.04
uses: actions/download-artifact@v4
with:
name: wheel-ubuntu-22.04
path: dist
- name: Download artifact macos-13
uses: actions/download-artifact@v4
with:
name: wheel-macos-13
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1