-
Notifications
You must be signed in to change notification settings - Fork 154
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
rathishcholarajan
merged 26 commits into
Qiskit:main
from
daka1510:refactor-test-workflow
Jan 28, 2022
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
ffa174f
new workflow test
daka1510 a9286ae
new workflow test
daka1510 10d5a97
new workflow test
daka1510 3bb407d
new workflow test
daka1510 0d0b9f4
prepare decorators for running tests separately against legacy/cloud
daka1510 608cd6e
Merge branch 'main' into refactor-test-workflow
daka1510 9f85391
[ci skip] use new decorators (part 1)
daka1510 1ae508a
[ci skip] use new decorators (part 2)
daka1510 db4686a
enable CI
daka1510 1c545ea
Merge remote-tracking branch 'daka1510/refactor-test-workflow' into r…
daka1510 02d0d38
only run integration tests on push events
daka1510 d01629c
fix lint
daka1510 761cfef
fix unit tests
daka1510 aa64a0d
update scheduled job runs
daka1510 55465fa
update scheduled job runs
daka1510 e7478bf
fix integration test casess
daka1510 0bc55ff
limit concurrent workflow runs per branch
daka1510 9f7e79c
remove broken if
daka1510 99843a0
[ci skip] update integration test yaml
daka1510 45ff4e2
[ci skip] update contribution guidelines
daka1510 129af4d
Merge branch 'main' into refactor-test-workflow
daka1510 15e0985
Merge branch 'main' into refactor-test-workflow
rathishcholarajan d00f027
Merge branch 'main' into refactor-test-workflow
daka1510 1d30a8a
Merge remote-tracking branch 'daka1510/refactor-test-workflow' into r…
daka1510 f9816fd
Merge branch 'main' into refactor-test-workflow
rathishcholarajan 5dbf6b5
Merge branch 'main' into refactor-test-workflow
rathishcholarajan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
andpush.yml
that were mostly the same and included duplicated job definitions.Notable Changes
if
conditionspush tests
->integration tests
andpr tests
->unit tests
Let's discuss objections related to the updated CI approach in this thread.