diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..a6dfb13dd --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,82 @@ +name: Tests +on: + push: + branches: [ master, 'stable/*' ] + pull_request: + branches: [ master, 'stable/*' ] +jobs: + tests: + name: tests-python${{ matrix.python-version }}-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [3.5, 3.6, 3.7, 3.8] + os: ["macOS-latest", "ubuntu-latest"] + 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 Deps + run: python -m pip install -U tox setuptools virtualenv wheel + - name: Install and Run Tests + run: tox -e py + if: runner.os != 'macOS' + - name: Install and Run Tests + env: + QISKIT_IN_PARALLEL: TRUE + run: tox -e py + if: runner.os == 'macOS' + windows-tests: + name: tests-python${{ matrix.python-version }}-windows + runs-on: windows-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] + steps: + - uses: actions/checkout@v2 + - uses: goanpeca/setup-miniconda@v1 + with: + activate-environment: ignis + auto-update-conda: true + channels: conda-forge + python-version: ${{ matrix.python-version }} + - name: Install cvxopt + run: conda install tox cvxopt -y + shell: pwsh + - name: Install and Run Tests + run: tox --sitepackages -epy + shell: bash -l {0} + lint: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install Deps + run: python -m pip install -U tox + - name: Run lint + run: tox -elint + docs: + name: docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install Deps + run: python -m pip install -U tox + - name: Build Docs + run: tox -edocs + - uses: actions/upload-artifact@v2 + with: + name: html_docs + path: docs/_build/html diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..b71c71ecb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: Release Artifacts +on: + push: + tags: + - '*' +jobs: + wheel-build: + name: Build and Publish Release Artifacts + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.8' + - name: Install Deps + run: pip install -U twine wheel + - name: Build Artifacts + run: | + python setup.py sdist + python setup.py bdist_wheel + shell: bash + - uses: actions/upload-artifact@v2 + with: + path: ./dist/qiskit* + - name: Publish to PyPi + env: + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + TWINE_USERNAME: qiskit + run: twine upload dist/qiskit* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 22b12d451..000000000 --- a/.travis.yml +++ /dev/null @@ -1,127 +0,0 @@ -cache: - pip: true - directories: - - .stestr -sudo: false - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - gcc-4.8 - - g++-4.8 - - libblas-dev - - liblapack-dev - -install_osx: &stage_osx - os: osx - osx_image: xcode9.4 - language: generic - cache: - pip: true - directories: - - ~/python-interpreters/ - - .stestr - before_install: - # Travis does not provide support for Python 3 under osx - it needs to be - # installed manually. - | - if [ ${TRAVIS_OS_NAME} = "osx" ]; then - if [[ ! -d ~/python-interpreters/$PYTHON_VERSION ]]; then - git clone git://github.com/pyenv/pyenv.git - cd pyenv/plugins/python-build - ./install.sh - cd ../../.. - python-build $PYTHON_VERSION ~/python-interpreters/$PYTHON_VERSION - fi - sudo pip2 install -U virtualenv pip setuptools - virtualenv --python ~/python-interpreters/$PYTHON_VERSION/bin/python venv - source venv/bin/activate - fi - -stages: - - lint_and_python - - all_python - -matrix: - fast_finish: true - include: - - python: "3.5" - env: TOXENV=py35 - name: "Python 3.5 Tests" - stage: all_python - - python: "3.6" - env: TOXENV=py36 - name: "Python 3.6 Tests" - stage: all_python - - os: linux - dist: xenial - python: "3.7" - env: TOXENV=py37 - name: "Python 3.7 Tests" - stage: lint_and_python - - os: linux - dist: xenial - python: "3.8" - env: TOXENV=py38 - name: "Python 3.8 Tests" - stage: all_python - - python: "3.7" - dist: xenial - env: TOXENV=lint - name: "Linter Checks" - stage: lint_and_python - - stage: all_python - name: "Python 3.5 Tests on OSX" - <<: *stage_osx - env: - - MPLBACKEND=ps - - PYTHON_VERSION=3.5.9 - - TOXENV=py35 - - stage: all_python - name: "Python 3.6 Tests on OSX" - <<: *stage_osx - env: - - MPLBACKEND=ps - - PYTHON_VERSION=3.6.10 - - TOXENV=py36 - - stage: lint_and_python - <<: *stage_osx - name: "Python 3.7 Tests on OSX" - env: - - MPLBACKEND=ps - - PYTHON_VERSION=3.7.6 - - TOXENV=py37 - - stage: all_python - <<: *stage_osx - name: "Python 3.8 Tests on OSX" - if: type = cron - env: - - MPLBACKEND=ps - - PYTHON_VERSION=3.8.1 - - TOXENV=py38 - - python: "3.8" - name: "Python 3.8 tests without optional dependencies" - stage: all_python - env: TOXENV=no-opt - stage: all_python - script: tox - - if: tag IS present - python: "3.6" - env: - - TWINE_USERNAME=qiskit - install: pip install -U twine - script: - - python3 setup.py sdist bdist_wheel - - twine upload dist/qiskit* - -language: python -install: pip install -U tox pip virtualenv setuptools six -script: - - tox --notest - - .tox/$TOXENV/bin/pip install --no-cache-dir cvxopt - - tox - -notifications: - email: false diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 0d1ab3fdb..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,82 +0,0 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -trigger: - branches: - include: - - master - - stable/* -pr: - autoCancel: true - branches: - include: - - '*' - -jobs: - - job: 'Docs' - pool: {vmImage: 'ubuntu-16.04'} - strategy: - matrix: - Python37: - python.version: '3.7' - steps: - - checkout: self - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - displayName: 'Use Python $(python.version)' - - bash: | - set -e - python -m pip install --upgrade pip virtualenv - pip install -U tox - python setup.py build_ext --inplace - displayName: 'Install dependencies' - - bash: | - tox -edocs - displayName: 'Run Docs build' - - task: ArchiveFiles@2 - inputs: - rootFolderOrFile: 'docs/_build/html' - archiveType: tar - archiveFile: '$(Build.ArtifactStagingDirectory)/html_docs.tar.gz' - verbose: true - - task: PublishBuildArtifacts@1 - displayName: 'Publish docs' - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: 'html_docs' - - job: 'windows' - pool: - vmImage: 'vs2017-win2016' - strategy: - matrix: - Python35: - python.version: '3.5' - TOXENV: py35 - Python36: - python.version: '3.6' - TOXENV: py36 - Python37: - python.version: '3.7' - TOXENV: py37 - Python38: - python.version: '3.8' - TOXENV: py38 - - steps: - - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" - displayName: Add conda to PATH - - script: conda create --yes --quiet --name qiskit-ignis python=%PYTHON_VERSION% - displayName: Create Anaconda environment - - bash: | - set -e - set -x - source activate qiskit-ignis - conda config --add channels conda-forge - conda install cvxopt -y - python -m pip install -c constraints.txt --upgrade pip virtualenv 'setuptools<50' - pip install -c constraints.txt -U tox - tox --sitepackages - displayName: 'Install dependencies and run tests' diff --git a/tox.ini b/tox.ini index 5d12b44d5..daf378e60 100644 --- a/tox.ini +++ b/tox.ini @@ -14,6 +14,7 @@ deps = numpy>=1.13 Cython>=0.27.1 setuptools>=40.1.0 cvxpy>=1.0.15 +passenv = QISKIT_IN_PARALLEL commands = pip install -U -c constraints.txt git+https://github.com/Qiskit/qiskit-terra.git pip install -U -c constraints.txt -r{toxinidir}/requirements-dev.txt