Merge pull request #14 from MaxBo/feature/py313 #55
This file contains hidden or 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: Build Cythonarrays for Linux | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
tags: | |
- v[0-9].[0-9]+.[0-9]+ | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup base conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: 3.12 | |
auto-activate-base: true | |
activate-environment: true | |
miniforge-version: latest | |
mamba-version: "*" | |
channels: MaxBo, conda-forge | |
conda-remove-defaults: true | |
- name: Install dependencies and set channels | |
run: | | |
mamba install conda-build anaconda-client twine readme_renderer | |
mamba create -q -n test-environment python=${{ matrix.python-version }} | |
- name: Build wheel and run tests for cythonarrays | |
shell: bash -el {0} | |
run: | | |
( | |
eval "$($CONDA_EXE shell.bash activate test-environment)" | |
which python | |
cd cythonarrays | |
pip install build pytest-cov | |
pip install -r requirements.txt | |
pip install . | |
python -m pytest --pyargs cythonarrays | |
python -m build -n . | |
echo "### All tests with pip passed! :rocket:" >> $GITHUB_STEP_SUMMARY | |
) | |
- name: Build and test cythonarrays | |
run: | | |
export TMPDIR=${{ runner.TEMP }} | |
export CONDA_BLD_PATH=$TMPDIR | |
conda build --python ${{ matrix.python-version }} cythonarrays/conda.recipe | |
- name: Create Docs | |
if: ${{ matrix.python-version == '3.12' }} | |
run: | | |
eval "$(mamba shell hook --shell bash)" | |
mamba activate test-environment | |
cd cythonarrays | |
pip install sphinx sphinxcontrib-napoleon sphinx-autodoc-typehints 'mistune<2' m2r2 'docutils<0.20' pytest | |
sphinx-apidoc -f --separate -o docs_rst/cythonarrays src/cythonarrays | |
sphinx-build docs_rst ../docs | |
- name: Deploy Docs to gh-pages | |
if: ${{ matrix.python-version == '3.12' && github.ref == 'refs/heads/master' }} | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: docs # The folder the action should deploy. | |
- name: Upload files for cythonarrays | |
shell: bash -el {0} | |
env: | |
ANACONDA_TOKEN: ${{ secrets.ANACONDA_GITHUBACTION_TOKEN }} | |
ANACONDA_USERNAME: MaxBo | |
CONDA_BLD_PATH: ${{ runner.TEMP }} | |
run: | | |
eval "$(mamba shell hook --shell bash)" | |
mamba activate base | |
anaconda -t $ANACONDA_TOKEN upload --skip-existing --user $ANACONDA_USERNAME $CONDA_BLD_PATH/linux-64/cythonarrays-*.conda |