Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor environment variables used by test cases #114

Merged
merged 26 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ffa174f
new workflow test
daka1510 Jan 20, 2022
a9286ae
new workflow test
daka1510 Jan 20, 2022
10d5a97
new workflow test
daka1510 Jan 20, 2022
3bb407d
new workflow test
daka1510 Jan 20, 2022
0d0b9f4
prepare decorators for running tests separately against legacy/cloud
daka1510 Jan 20, 2022
608cd6e
Merge branch 'main' into refactor-test-workflow
daka1510 Jan 20, 2022
9f85391
[ci skip] use new decorators (part 1)
daka1510 Jan 20, 2022
1ae508a
[ci skip] use new decorators (part 2)
daka1510 Jan 20, 2022
db4686a
enable CI
daka1510 Jan 20, 2022
1c545ea
Merge remote-tracking branch 'daka1510/refactor-test-workflow' into r…
daka1510 Jan 20, 2022
02d0d38
only run integration tests on push events
daka1510 Jan 20, 2022
d01629c
fix lint
daka1510 Jan 21, 2022
761cfef
fix unit tests
daka1510 Jan 21, 2022
aa64a0d
update scheduled job runs
daka1510 Jan 21, 2022
55465fa
update scheduled job runs
daka1510 Jan 21, 2022
e7478bf
fix integration test casess
daka1510 Jan 21, 2022
0bc55ff
limit concurrent workflow runs per branch
daka1510 Jan 21, 2022
9f7e79c
remove broken if
daka1510 Jan 21, 2022
99843a0
[ci skip] update integration test yaml
daka1510 Jan 21, 2022
45ff4e2
[ci skip] update contribution guidelines
daka1510 Jan 21, 2022
129af4d
Merge branch 'main' into refactor-test-workflow
daka1510 Jan 24, 2022
15e0985
Merge branch 'main' into refactor-test-workflow
rathishcholarajan Jan 24, 2022
d00f027
Merge branch 'main' into refactor-test-workflow
daka1510 Jan 25, 2022
1d30a8a
Merge remote-tracking branch 'daka1510/refactor-test-workflow' into r…
daka1510 Jan 25, 2022
f9816fd
Merge branch 'main' into refactor-test-workflow
rathishcholarajan Jan 27, 2022
5dbf6b5
Merge branch 'main' into refactor-test-workflow
rathishcholarajan Jan 28, 2022
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
139 changes: 139 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# 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
Copy link
Collaborator Author

@daka1510 daka1510 Jan 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow definitions replaces pr.yml and push.yml that were mostly the same and included duplicated job definitions.

Notable Changes

  • no concurrent workflow runs per branch (previous workflows are cancelled automatically)
  • previous behavior implemented via if conditions
  • rephrased push tests -> integration tests and pr tests -> unit tests
  • added build dependencies to make sure resource expensive integration tests are only run when everything else passes
    image

Let's discuss objections related to the updated CI approach in this thread.

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:
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 coverage
- name: Upload unit test coverage report
uses: actions/upload-artifact@v2
with:
name: Unit test coverage report - python${{ matrix.python-version }}-${{ matrix.os }}
path: htmlcov
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:
matrix:
python-version: [ 3.9 ]
os: [ "ubuntu-latest" ]
environment: [ "legacy-production", "cloud-production" ]
environment: ${{ matrix.environment }}
env:
QISKIT_IBM_TOKEN: ${{ secrets.QISKIT_IBM_TOKEN }}
QISKIT_IBM_URL: ${{ secrets.QISKIT_IBM_URL }}
QISKIT_IBM_INSTANCE: ${{ secrets.QISKIT_IBM_INSTANCE }}
LOG_LEVEL: DEBUG
STREAM_LOG: True
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 integration tests
run: make coverage
- name: Upload integration test coverage report
uses: actions/upload-artifact@v2
with:
name: Integration test coverage report - ${{ matrix.environment }}
path: htmlcov
107 changes: 0 additions & 107 deletions .github/workflows/cron-prod.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/cron-slow-terra-main.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/cron-slow.yml

This file was deleted.

Loading