fix python 3.12 build #316
Workflow file for this run
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: Main | |
on: [push, pull_request] | |
jobs: | |
cleanup: | |
name: Cancel Previous Runs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
pytest: | |
name: ${{ matrix.os }} r-${{ matrix.r }} py-${{ matrix.python }} | |
strategy: | |
fail-fast: false | |
matrix: | |
r: [4.1, latest, devel] | |
python: [3.8, 3.12] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install rchitect | |
run: python -m pip install -e .[test] | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.r }} | |
- name: Install reticulate | |
run: Rscript -e "install.packages('reticulate')" | |
- name: Insert LD_LIBRARY_PATH | |
if: matrix.os == 'ubuntu-latest' || startsWith(matrix.os, 'macos') | |
run: echo LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`R RHOME`/lib" >> $GITHUB_ENV | |
- name: Run tests | |
run: pytest -s --cov=rchitect | |
- name: codecov | |
run: | | |
python -m pip install codecov | |
codecov | |
env: | |
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} | |
check_tarball: | |
name: Check tarball is installable | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: 3.11 | |
- run: | | |
python setup.py sdist | |
pip install dist/rchitect-*.tar.gz | |
build_wheels: | |
needs: [pytest, check_tarball] | |
name: Build wheels on ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
env: | |
# a wheel with wrong arch might be installed | |
CIBW_BEFORE_BUILD_MACOS: "pip install -U setuptools wheel cffi" | |
CIBW_ARCHS_MACOS: "x86_64 arm64" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: ./wheelhouse/*.whl | |
twine: | |
name: Upload tarball and wheels | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- build_wheels | |
runs-on: ubuntu-latest | |
env: | |
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}} | |
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: 3.8 | |
- run: python -m pip install twine | |
- run: | | |
python setup.py sdist | |
python -m twine upload dist/* | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
path: ./wheelhouse | |
- run: python -m twine upload ./wheelhouse/*.whl |