Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

name: CI
on:
[ push, pull_request ]
# save resources: cancel redundant workflow runs on the same branch when new commits are pushed
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
code-quality:
name: Run code quality checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c constraints.txt -e .
pip install -U -c constraints.txt -r requirements-dev.txt
- name: Run black
run: make style
- name: Run lint
run: make lint
- name: Run mypy
run: make mypy
documentation:
name: Build documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U tox
sudo apt install -y graphviz pandoc
pip install -c constraints.txt -e .
- name: Build documentation
run: tox -edocs
- name: Upload documentation
uses: actions/upload-artifact@v2
with:
name: html_docs
path: docs/_build/html
unit-tests:
# only kick-off test cases when basic code quality checks succeed
needs: [ "code-quality" , "documentation" ]
name: Run unit tests - python${{ matrix.python-version }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
os: [ "macOS-latest", "ubuntu-latest", "windows-latest" ]
env:
QISKIT_IBM_API_TOKEN: ${{ secrets.QISKIT_IBM_API_TOKEN }}
QISKIT_IBM_API_URL: ${{ secrets.QISKIT_IBM_API_URL }}
QISKIT_IBM_HGP: ${{ secrets.QISKIT_IBM_HGP }}
QISKIT_IBM_PRIVATE_HGP: ${{ secrets.QISKIT_IBM_PRIVATE_HGP }}
LOG_LEVEL: DEBUG
STREAM_LOG: True
QISKIT_TESTS: skip_online
QISKIT_IN_PARALLEL: True
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c constraints.txt -e .
pip install -U -c constraints.txt -r requirements-dev.txt
- name: Run unit tests
run: make test-coverage
- name: Report coverage to coveralls.io
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: unit-tests_python${{ matrix.python-version }}-${{ matrix.os }}
parallel: true
path-to-lcov: coverage.lcov
integration-tests:
if: ${{ github.event_name == 'push' }}
# only kick-off resource intensive integration tests if unit tests and all basic checks succeeded
needs: [ "unit-tests" ]
name: Run integration tests - ${{ matrix.environment }}
runs-on: ${{ matrix.os }}
strategy:
# avoid cancellation of in-progress jobs if any matrix job fails
fail-fast: false
matrix:
python-version: [ 3.9 ]
os: [ "ubuntu-latest" ]
env:
QISKIT_IBM_API_TOKEN: ${{ secrets.QISKIT_IBM_API_TOKEN }}
QISKIT_IBM_API_URL: ${{ secrets.QISKIT_IBM_API_URL }}
QISKIT_IBM_HGP: ${{ secrets.QISKIT_IBM_HGP }}
QISKIT_IBM_PRIVATE_HGP: ${{ secrets.QISKIT_IBM_PRIVATE_HGP }}
LOG_LEVEL: DEBUG
STREAM_LOG: True
QISKIT_IN_PARALLEL: True
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 --upgrade pip
pip install -c constraints.txt -e .
pip install -U -c constraints.txt -r requirements-dev.txt
- name: Run Tests
run: make test
tests-finished:
name: Submit code coverage metrics
needs: [ unit-tests ]
runs-on: ubuntu-latest
steps:
- name: Notify coveralls.io that all parallel tests have finished
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
85 changes: 0 additions & 85 deletions .github/workflows/main.yml

This file was deleted.

87 changes: 0 additions & 87 deletions .github/workflows/pr.yml

This file was deleted.

4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ style:
test:
python -m unittest -v

test-coverage:
coverage run -m unittest -v
coverage lcov

test1:
python -m unittest -v test/ibm/test_ibm_backend.py test/ibm/test_account_client.py test/ibm/test_ibm_job_states.py test/ibm/test_tutorials.py test/ibm/test_basic_server_paths.py test/ibm/test_proxies.py test/ibm/test_ibm_integration.py test/ibm/test_ibm_logger.py test/ibm/test_filter_backends.py test/ibm/test_registration.py

Expand Down
3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ qiskit_rng
qiskit-aer
websockets>=8
scikit-quant;platform_system != 'Windows'
black==22.1.0
black==22.1.0
coverage>=6.3
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[coverage:run]
source = qiskit_ibm_provider

[mypy]
python_version = 3.7
namespace_packages = True
Expand Down