diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..26ed42c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,68 @@ +name: Main + +on: + push: + pull_request: + +jobs: + test: + name: Run tests + runs-on: ubuntu-latest + strategy: + matrix: + python_version: [3.6, 3.7, 3.8, 3.9] + install_extras: ['tests', 'plotting,fancy_progressbar,tests', 'plotting,bloch_sphere_visualization,fancy_progressbar,doc,tests'] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python_version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python_version }} + + - name: Install + run: | + python -m pip install --upgrade pip + pip install .[${{ matrix.install_extras }}] + + - name: Test with pytest + run: | + pytest + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + name: ${{ matrix.python }} - ${{ matrix.install_extras }} + env_vars: OS,PYTHON + fail_ci_if_error: true + + release: + name: Publish to PyPi + runs-on: ubuntu-latest + needs: test + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + + - name: Build package + run: | + python setup.py sdist bdist_wheel + + - name: Publish package + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + twine upload dist/* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3cc8332..0000000 --- a/.travis.yml +++ /dev/null @@ -1,87 +0,0 @@ -os: linux -dist: xenial -language: python - -python: - - 3.6 - - 3.7 - - 3.8 - - 3.9 -env: - global: - - INSTALL_DEPS="numpy scipy opt_einsum sparse tqdm" - - INSTALL_TEST_DEPS="pytest>=4.6 pytest-cov codecov" - - plotting="matplotlib" - - fancy_progressbar="ipynbname jupyter" - - bloch_sphere_visualization="matplotlib qutip" - jobs: - - INSTALL_EXTRAS=[plotting,bloch_sphere_visualization,fancy_progressbar] - - INSTALL_EXTRAS=[plotting,fancy_progressbar] - - INSTALL_EXTRAS=[none] - -# Cache pip packages -cache: - pip: true - timeout: 1000 - directories: - - $HOME/miniconda - -before_cache: - - rm -rf $HOME/miniconda/locks $HOME/miniconda/pkgs $HOME/miniconda/var - - rm -rf $HOME/miniconda/conda-bld $HOME/miniconda/conda-meda/history - -before_install: - # Resolve INSTALL_EXTRAS into required packages for use with conda. HACKY - # Split by comma and replace by parameter designator ($) - - TMP=${INSTALL_EXTRAS//,/ $} - # Take care of opening bracket separately - - TMP=${TMP/[/$} - # Replace the abstract extra names by the packages they require - - TMP=$(eval echo ${TMP%]}) - # Remove ipynbname from conda packages (pip only) - - INSTALL_EXTRAS_CONDA=${TMP// ipynbname/} - - # Useful info for debugging - - echo $TRAVIS_PYTHON_VERSION - - echo $INSTALL_DEPS - - echo $INSTALL_TEST_DEPS - - echo $INSTALL_EXTRAS - - echo $INSTALL_EXTRAS_CONDA - - # https://github.com/conda/conda/blob/master/docs/source/user-guide/tasks/use-conda-with-travis-ci.rst - - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - - bash miniconda.sh -b -u -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda config --append channels conda-forge - - conda update -q conda - # Useful for debugging any issues with conda - - conda info -a - - - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION $INSTALL_DEPS $INSTALL_TEST_DEPS $INSTALL_EXTRAS_CONDA - - source activate test-environment - -install: - # Everything from INSTALL_EXTRAS should already be installed via conda, except for ipynbname - - pip install .$INSTALL_EXTRAS - -script: - - pytest - -after_success: - - codecov - -notifications: - email: false - -deploy: - provider: pypi - distributions: "sdist bdist_wheel" - edge: true # use travis deployment v2 - on: - tags: true # only deploy tagged commits - skip_existing: true # upload artifacts only once - username: "__token__" - password: - secure: "IGpk0C5hrt3CA6jddAyzGUC5S/EQMFsORNdktE/O9L/kgOlryIxH8eo1AICH8quc1d4bqVrnKmeM5c9RJ1j6GIkvQ84RYF67Tcnd4Ik3fHwYEth9ccbeD8e9WRrP8tCKR3Ex6QU7oUrXKH6UdoovTd2QlxRzkfLjzUgnGGO5avcmWZmEcq+Gq3JO1Wn7o1HEoJUFiRkW2pRBrpkl5ou0YV4zrFesdq9+AvCCl62wWdq9o6R38BWaQCdAd8gWDncTJ6eolNGMapq+7rnz6HCGdadx302w9eTfc3dnPlvI3EEpOlNFcDksiPMud6q5DxVaKbt+uv75uNkD+ZXVWHvQBTqE+cxJjTgfiL2p0K0U1RtWFCQq4CXRlsGEDy+YDGcyoqLa+sTG+9qR9GMUvwIdTeWfZQLx/lKFZHsHPfGGjE1Jj7rpJTVsDrQVNFmSzpuGJYfWjGc4X4GToRpPqPanL6UBhi3PjOWl+gQ1p8uqKzy7BEKX1deVx41K/qHCEDV2JFm373VG4I/u+EfPSSwar2VWjwzPUUI9uAJyVf0Ml7N9SRerHJ+8AXvLgQAQGwMTJrswMhyrQhMgkx8wyCegoAY1J8FvcA9XH+W8t9SQSrjMj16/+H06Krx3BIdk4/u9LQ4ezOldAAGSxTuqxFkOxdqyu9Fm2GLJxvss4J2SnTs=" diff --git a/README.md b/README.md index 028a57a..8093f40 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # `filter_functions`: A package for efficient numerical calculation of generalized filter functions to describe the effect of noise on quantum gate operations [![codecov](https://codecov.io/gh/qutech/filter_functions/branch/master/graph/badge.svg)](https://codecov.io/gh/qutech/filter_functions) -[![Build Status](https://travis-ci.org/qutech/filter_functions.svg?branch=master)](https://travis-ci.org/qutech/filter_functions) +[![Build status](https://github.com/qutech/filter_functions/actions/workflows/main.yml/badge.svg)](https://github.com/qutech/filter_functions/actions/workflows/main.yml) [![Documentation Status](https://readthedocs.org/projects/filter-functions/badge/?version=latest)](https://filter-functions.readthedocs.io/en/latest/?badge=latest) [![PyPI version](https://img.shields.io/pypi/v/filter-functions.svg)](https://pypi.org/project/filter-functions/) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4575001.svg)](https://doi.org/10.5281/zenodo.4575001)