diff --git a/.github/workflows/run_pydsd_ci.yml b/.github/workflows/run_pydsd_ci.yml new file mode 100644 index 0000000..0cc35ea --- /dev/null +++ b/.github/workflows/run_pydsd_ci.yml @@ -0,0 +1,46 @@ +name: run_pydsd_ci.yml +on: [push,pull_request ] +jobs: + build_and_publish: + name: Setup Environment, and run test suite + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Environment + uses: conda-incubator/setup-miniconda@v2 + with: + python-version: 3.7 + mamba-version: "*" + channels: conda-forge,defaults + channel-priority: true + activate-environment: pydsdci + environment-file: pydsd-ci.yml + - name: Run Pytest + shell: bash -l {0} + run: | + pytest + - name: Build package + shell: bash -l {0} + run: | + python -m build --wheel --outdir dist/ . + - name: Publish package to PYPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && github.ref == 'refs/heads/master' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: ${{ secrets.PYPI_USERNAME }} + password: ${{secrets.PYPI_PASSWORD}} + #repository_url: https://test.pypi.org/legacy/ + - name: Build Documentation + shell: bash -l {0} + run: | + pwd + pip install -e . + cd docs + make clean + make html + - name: Upload Documentation + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && github.ref == 'refs/heads/master' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 34e3e04..0000000 --- a/.travis.yml +++ /dev/null @@ -1,47 +0,0 @@ -sudo: false -env: - global: - - LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgfortran.so.3 - - secure: HC56kqcyplnfsHFZpM122GVdG8j0b6M1uexIJKVCpy8YS6u7ooS8Oh9jp6OxDyg47OtGJGRPeGvQJ2bMuKhbNz+3YHNxf08AJVApwPq+25PpfGedMWMgmZI42zAzN6RYVUDjYEZb3Y52j4Kw8UaFwfdxoPVFhTiRCgr054laZFc= -addons: - apt: - packages: - - gfortran -language: python -deploy: - provider: pypi - user: joseph.hardin - password: - secure: RXHwdpCq99AiCzO+uM8PFGUAP382tGEtPS0QnlbaAWN+6sCnHfpPyy9YClsv5N+PhIqKnHuX5O3nx/XlQVyaHMqbUxzReHYPvJFbbqNErlZ36DXNYxVWkqUgnNz1EbGxKQ08oTmBlTym138umsK1Wqu5+Mv913QaSQa6g1D6Kl4= - on: - tags: true - -matrix: - include: - - python: '3.6' - env: - - PYTHON_VERSION="3.6" - - PYTEST_ARGS="--cov=pydsd" - - COVERALLS="true" - - python: '3.7' - env: - - PYTHON_VERSION="3.7" - - PYTEST_ARGS="--cov=pydsd" - - COVERALLS="true" - - DOC_BUILD="true" - - python: '3.7' - env: - - PYTHON_VERSION="3.7" - - PYTEST_ARGS="--cov=pydsd" - - COVERALLS="true" -before_install: -- pip install pytest pytest-cov -- pip install coverage==4.5.4 -- pip install coveralls -install: source continuous_integration/install.sh -script: eval xvfb-run python -m pytest $PYTEST_ARGS -#script: eval xvfb-run nosetests $NOSE_ARGS -after_success: -# - coveralls -- if [[ "$DOC_BUILD" == "true" ]]; then cd $TRAVIS_BUILD_DIR; source continuous_integration/build_docs.sh; - fi diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh deleted file mode 100644 index d514a9d..0000000 --- a/continuous_integration/install.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# This script was adpated from the pyart install.sh script. -# This script is adapted from the install.sh script from the scikit-learn -# project: https://github.com/scikit-learn/scikit-learn - -# This script is meant to be called by the "install" step defined in -# .travis.yml. See http://docs.travis-ci.com/ for more details. -# The behavior of the script is controlled by environment variabled defined -# in the .travis.yml in the top level folder of the project. - -set -e -# use next line to debug this script -#set -x - -# Use Miniconda to provide a Python environment. This allows us to perform -# a conda based install of the SciPy stack on multiple versions of Python -# as well as use conda and binstar to install additional modules which are not -# in the default repository. -wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - -O miniconda.sh -chmod +x miniconda.sh -./miniconda.sh -b -export PATH=/home/travis/miniconda3/bin:$PATH - -conda config --set always_yes yes -conda config --set show_channel_urls true -conda update -q conda - -# Create a testenv with the correct Python version -conda create -n testenv --yes pip python=$PYTHON_VERSION -source activate testenv - -# Install dependencies - -conda install -c conda-forge pytmatrix pytest pytest-cov=2.5 sphinx_rtd_theme numpy scipy matplotlib netcdf4 nose sphinx numpydoc hdf4 - -pip install sphinx-gallery nose-cov - -if [[ $PYTHON_VERSION == '2.7' ]]; then - pip install sphinxcontrib-bibtex - pip install xmltodict -fi - - -# install coverage modules -if [[ "$COVERALLS" == "true" ]]; then - pip install 'coverage<5.0' - pip install coveralls -fi - -pip install -e . diff --git a/pydsd-ci.yml b/pydsd-ci.yml new file mode 100644 index 0000000..ebd1596 --- /dev/null +++ b/pydsd-ci.yml @@ -0,0 +1,24 @@ +name: pydsdci +channels: + - conda-forge + - defaults +dependencies: + - python=3.7 + - pytmatrix=0.3.2 # 0.3.3 has a bug + - coveralls + - pytest + - pytest-cov=2.5 + - sphinx_rtd_theme + - numpy + - scipy + - matplotlib + - netcdf4 + - sphinx + - numpydoc + - hdf4 + - pip + - pip: + - sphinx-gallery + - twine + - wheel + - build