Skip to content

Commit

Permalink
Modifies the CI workflow
Browse files Browse the repository at this point in the history
Build Conda for python 3.7, 3.8, 3.9, 3.10
Build and push to pypi (bdist and sdist) for python 3.7, 3.8, 3.9, 3.10
Fix issues on Windows for Python >=3.8 (DLL Loading)
Set RPATH in setup.py
Tests running on Windows, Linux, MacOSX
Tested on Mac M1 with Python 3.9
  • Loading branch information
rbeucher committed Mar 30, 2022
1 parent d7209b0 commit 7641ade
Show file tree
Hide file tree
Showing 11 changed files with 337 additions and 368 deletions.
325 changes: 325 additions & 0 deletions .github/workflows/CI.yml
@@ -0,0 +1,325 @@
name: CI

on:
push:
release:
workflow_dispatch:

jobs:

test_ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install numpy
pip install scipy
pip install Cython
- name: Install
run: |
pip install .
- name: Run tests
run: |
pip install pytest
pytest -v
test_macos:
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install numpy
pip install scipy
pip install Cython
- name: Provide gfortran
run: |
ln -s /usr/local/bin/gfortran-10 /usr/local/bin/gfortran
- name: Install
run: |
pip install .
- name: Run tests
run: |
pip install pytest
pytest -v
test_windows:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install numpy
pip install scipy
pip install Cython
- name: Install
run: |
pip install .
- name: Run tests
run: |
pip install pytest
pytest -v
conda_build_ubuntu:
name: Conda Build (Python ${{matrix.python-version}})
needs: [test_ubuntu]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}

- name: Config Conda
shell: bash -l {0}
run: |
conda install --channel conda-forge conda-build anaconda-client conda-verify
conda config --add channels conda-forge
conda config --add channels underworldcode
conda config --set anaconda_upload no
- name: Config Conda For Upload
if: github.event_name == 'release'
shell: bash -l {0}
run: conda config --set anaconda_upload yes

- name: Upload new Packages
if: github.event_name == 'release'
shell: bash -l {0}
run: |
anaconda login --hostname github-actions-${{ matrix.os }}-$RANDOM --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_PASSWORD }}
conda-build --channel conda-forge --user geo-down-under conda
anaconda logout
conda_build_macos:
name: Conda Build (Python ${{matrix.python-version}})
needs: [test_macos]
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}

- name: Config Conda
shell: bash -l {0}
run: |
conda install --channel conda-forge conda-build anaconda-client conda-verify
conda config --add channels conda-forge
conda config --add channels underworldcode
conda config --set anaconda_upload no
- name: Config Conda For Upload
if: github.event_name == 'release'
shell: bash -l {0}
run: conda config --set anaconda_upload yes

- name: Upload new Packages
if: github.event_name == 'release'
shell: bash -l {0}
run: |
anaconda login --hostname github-actions-${{ matrix.os }}-$RANDOM --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_PASSWORD }}
conda-build --channel conda-forge --user geo-down-under conda
anaconda logout
conda_build_windows:
name: Conda Build (Python ${{matrix.python-version}} ${{ matrix.os }})
needs: [test_windows]
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}

- name: Config Conda
shell: bash -l {0}
run: |
conda install --channel conda-forge conda-build anaconda-client conda-verify
conda config --add channels conda-forge
conda config --add channels underworldcode
conda config --set anaconda_upload no
- name: Config Conda For Upload
if: github.event_name == 'release'
shell: bash -l {0}
run: conda config --set anaconda_upload yes

- name: Upload new Packages
if: github.event_name == 'release'
shell: bash -l {0}
run: |
anaconda login --hostname github-actions-${{ matrix.os }}-$RANDOM --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_PASSWORD }}
conda-build --channel conda-forge --user geo-down-under conda
anaconda logout
pypi_windows:
runs-on: windows_latest
needs: test_windows
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install numpy
pip install scipy
pip install Cython
- name: Provide gfortran
run: |
ln -s /usr/local/bin/gfortran-10 /usr/local/bin/gfortran
- name: Package for Pypi
run: |
python setup.py sdist bdist_wheel
- name: Upload to Pypi
run: |
python -m twine upload dist/* -r pypi --skip-existing
pypi_macos:
runs-on: macos-latest
needs: test_macos
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install numpy
pip install scipy
pip install Cython
- name: Provide gfortran
run: |
ln -s /usr/local/bin/gfortran-10 /usr/local/bin/gfortran
- name: Package for Pypi
run: |
python setup.py sdist bdist_wheel
- name: Upload to Pypi
run: |
python -m twine upload dist/* -r pypi --skip-existing
manylinux:
name: Build manylinux package
needs: test_ubuntu
runs-on: ubuntu-latest
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools twine wheel
pip install numpy
pip install scipy
pip install Cython
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.4.2-manylinux2014_x86_64
with:
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
pip-wheel-args: '--no-deps'
build-requirements: 'cython numpy'
- name: Publish wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload *-manylinux*.whl --skip-existing
51 changes: 0 additions & 51 deletions .github/workflows/conda_deploy.yml

This file was deleted.

0 comments on commit 7641ade

Please sign in to comment.