Skip to content

Conversation

raynelfss
Copy link
Contributor

@raynelfss raynelfss commented Nov 21, 2024

Summary

Fixes #12807.
The following commits move existing workflows from Azure into Github Actions.

Details and comments

As simple as it may seem, our CI Pipeline goes through several workflows, some of which are split between Github Actions and Azure Workflows. While Azure Workflows provided us with many extra features and an isolated quota, tests seem to run much slower than they would with Github Actions (exact numbers to be examined). This move will (most likely) ensure that workflows run faster increasing our overall commit throughput.

The moved workflows include:

  • Pull Requests:
    • Docs and Lint
    • Python and partial rust tests.
  • Commits:
    • On push
    • Nightly tests
    • Merge queue

New Pull Request workflow

The new PR workflow looks as such:
image
Where if both Docs and Lint and Preliminary Tests pass, then the rest of the test suite runs concurrently.
For a successful run of all workflows please refer to this example run from this PR.

Tasks

  • Move Lint and Docs
  • Move Python Tests
  • Organize concurrency
  • Add nightly tests
  • Merge queue tests
  • Run nightly matrix tests when code changes.

Known issues

  • How to properly test merge-queue, push, nightly tests.
  • Main nightly tests should only run when new changes in the code are introduced (as per the previous azure workflow).

@raynelfss raynelfss added the type: qa Issues and PRs that relate to testing and code quality label Nov 21, 2024
@coveralls
Copy link

coveralls commented Nov 21, 2024

Pull Request Test Coverage Report for Build 15215061156

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 322 unchanged lines in 15 files lost coverage.
  • Overall coverage increased (+0.04%) to 88.334%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 2 92.48%
qiskit/circuit/parameter.py 2 97.01%
qiskit/transpiler/passes/optimization/consolidate_blocks.py 2 96.61%
qiskit/circuit/library/generalized_gates/unitary.py 4 89.66%
qiskit/primitives/containers/observables_array.py 4 96.53%
qiskit/synthesis/unitary/qsd.py 5 96.62%
crates/circuit/src/lib.rs 6 94.96%
crates/qasm2/src/parse.rs 6 97.61%
qiskit/transpiler/preset_passmanagers/generate_preset_pass_manager.py 6 95.86%
qiskit/transpiler/preset_passmanagers/builtin_plugins.py 16 95.22%
Totals Coverage Status
Change from base Build 15121608528: 0.04%
Covered Lines: 78475
Relevant Lines: 88839

💛 - Coveralls

@raynelfss raynelfss force-pushed the move-to-gh branch 2 times, most recently from 74a0fe4 to ba1a164 Compare November 25, 2024 13:46
@raynelfss raynelfss force-pushed the move-to-gh branch 2 times, most recently from ebc3e6e to e0c9a46 Compare December 2, 2024 18:51
@raynelfss raynelfss added the Changelog: None Do not include in changelog label Dec 3, 2024
@raynelfss
Copy link
Contributor Author

I have yet to test the nightly, merge-queue, and push tests. But I believe they should work without issues since they're mostly reusing the same workflows we use here for Pull Requests CI. I'm going to open this up for review :)

@raynelfss raynelfss marked this pull request as ready for review December 3, 2024 19:57
@raynelfss raynelfss requested a review from a team as a code owner December 3, 2024 19:57
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@raynelfss raynelfss requested a review from mtreinish May 22, 2025 20:22
name: image-test-failure-img-diffs
path: |
./test/visual/mpl/graph/graph_results
./test/visual/mpl/circuit/circuit_results
Copy link
Member

Choose a reason for hiding this comment

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

This is also missing: test/visual/mpl/visual_test_failures

python -m venv test-job
.\test-job\Scripts\activate
python -m pip install -U pip setuptools wheel
python -m pip install -U `
Copy link
Member

Choose a reason for hiding this comment

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

I guess ` is the right syntax on windows cmd/powershell for the bash equivalent of \? I didn't realize that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, apparently this is the powershell syntax for continued line (source).

-r requirements.txt `
-r requirements-dev.txt `
-e .
pip check
Copy link
Member

Choose a reason for hiding this comment

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

This probably isn't needed here because it's a single pip command. This was originally needed before pip added a new dependency solver to validate your weren't relying on implicit behavior that would break. It's good to run on two successive pip calls still to check that you didn't break a dependency from the first install with the second (because the depsolver is only invoked per session and not shared across multiple calls).

mtreinish
mtreinish previously approved these changes May 23, 2025
Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

I think this LGTM now, lets wait for the test PR to pass the jobs to make sure and then we can make the migration.

@mtreinish mtreinish added this pull request to the merge queue May 23, 2025
@mtreinish mtreinish removed this pull request from the merge queue due to a manual request May 23, 2025
@mtreinish mtreinish enabled auto-merge May 23, 2025 16:37
@mtreinish mtreinish added this pull request to the merge queue May 23, 2025
Merged via the queue into Qiskit:main with commit 828cbf1 May 23, 2025
26 checks passed
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request May 28, 2025
In Qiskit#13474 we restructured our CI to be based solely on github actions.
As part of that change a new workflow structure was introduced where
there were `on-*.yml` files that enumerate the jobs run for each job
trigger. For example, `on-pull-request.yml` lists all the jobs that run
when a pull request is opened or updated. However, the C API tests were
not integrated into this new structure as part of Qiskit#13474 as they were
already running and that PR didn't want to change github actions usage
that was already working. This commit is the follow up that updates the
C API tests so they fit into the new structure and the jobs that are run
are listed in the specific trigger sections.
github-merge-queue bot pushed a commit that referenced this pull request May 28, 2025
In #13474 we restructured our CI to be based solely on github actions.
As part of that change a new workflow structure was introduced where
there were `on-*.yml` files that enumerate the jobs run for each job
trigger. For example, `on-pull-request.yml` lists all the jobs that run
when a pull request is opened or updated. However, the C API tests were
not integrated into this new structure as part of #13474 as they were
already running and that PR didn't want to change github actions usage
that was already working. This commit is the follow up that updates the
C API tests so they fit into the new structure and the jobs that are run
are listed in the specific trigger sections.
github-merge-queue bot pushed a commit that referenced this pull request May 28, 2025
* Integrate C API tests into new GHA workflow structure

In #13474 we restructured our CI to be based solely on github actions.
As part of that change a new workflow structure was introduced where
there were `on-*.yml` files that enumerate the jobs run for each job
trigger. For example, `on-pull-request.yml` lists all the jobs that run
when a pull request is opened or updated. However, the C API tests were
not integrated into this new structure as part of #13474 as they were
already running and that PR didn't want to change github actions usage
that was already working. This commit is the follow up that updates the
C API tests so they fit into the new structure and the jobs that are run
are listed in the specific trigger sections.

* Fix broken syntax

---------

Co-authored-by: Jake Lishman <jake@binhbar.com>
rahaman-quantum pushed a commit to rahaman-quantum/qiskit that referenced this pull request Jun 20, 2025
* Initial: Move docs and lint to gh actions

* Fix: Wrong usage of map in `lint_docs` workflow

* Fix: Use ubuntu-latest for lint

* Fix: Add step to delete `doctrees` and `buildinfo`
- Added `depth: 0` to checkout to avoid reno bugs.

* Add: First drafts of Linux tests

* Add: First draft of Windows tests

* Fix: Use Poweshell formatting for scripts in Windows

* Fix: Formatting for multiline commands in Powershell

* Fix: Remove `set -e` from all windows environments.

* Fix: Use correct powershell export patterns

* Add: First draft of new Mac tests

* Fix: Add cache step

* Add: CI main workflow.

* Fix: wrong usage of workflow calls.
- Rename `tests-linux.yml` to  `test-linux.yml`.

* Fix: Rename tests to their respective os

* Fix: Add correct library path for rust tests

* Add: Nightly, Merge-queue, and Push workflows
- Add comments
- Rename `Qiskit CI workflow` to `Pull Request`

* Refactor: ci-workflow -> on-pull-request

* Remove: All azure workflow files

* Fix: Use runner for issue comment
- Add missing `.yml` extension in reusable workflow references.

* Fix: Wrong name in MacOS tests

* Test: Remove main repository requirement
- For testing purposes.

* Fix: Adapt to latest changes
- Format documents

* Fix: Use matrix.os in test-linux

* Fix: Naming in test-linux

* Add condition to run nightly tests on PR for now

* Test: Run all new tests on PR

* Fix: Concurrency issue
- Fix wrong name being displayed for ubuntu tests.

* Fix: Further separate PR workflow from others

* Fix: Add condition for nightly-failure.

* Fix: Address review comments
- Split python, rust, and image tests.
- Move cformat to `lint`.
- Enable selecting either ubuntu-arm or latest for ubuntu runs.

* Fix: Indentation for rust and image tests

* Fix: Remove matrix from rust tests

* Fix: Remove matrix from images tests

* Fix: Update MSRV to 1.79

* Use gh CLI to comment on issues.

* Fix: Install `Qiskit` before running linux rust tests.

* FIx: Add argument to specify runners for Windows and MacOS.
- Add missing MacOS 13 runner to workflows.

* Fix: Run all PR workflows together.

* Fix: Incorrect display of names for unit tests

* Test: Only run PR workflow

* Fix: Use `ubuntu-latest` instead of `latest`

* Fix: Add missing gh token for issue comment

* Fix: Remove unnecessary merge-group from workflows

* Fix: Remove pull request stray comment

* Fix: Nightly tests were not able to comment on issues.
- Now only run on schedule

* Fix: Set timeout of 60 minutes for all jobs

* Fix: Use venv instead of virtualenv

* Fix: Remove stale comments about staged pipelines.

* Fix: Remove redundant naming

* Fix: "ubuntu-4.04-arm" to "ubuntu-24.04-arm" in "on-push"

* Fix: Remove "Preliminary Test" Name
- Use "Main Tests" name on all tests.

* Fix: Remove MacOS and ARM jobs from "on-push"

* Fix: Separate rust-tests and image-tests into their own workflows

* Fix: Naming convention for some tests in "on-pull-request"

* Fix: Address review comments

* Fix: Introduce new arguments for workflows
- For Rust tests: we can specify rust versions using `rust-version` input.
- For test runs: We can specify to run msrv by using `use-msrv` input.

* Fix: Use dtolnay/rust-toolchain@master

* Fix: Use global env for rust tests

* FIx: Perform pip install in one line

* Test: Remove rust toolchain action

* Fix: Remove rust toolchain step from rust tests

* Fix: Clean up nightly matrix tests.
- Consolidate nightlty jobs into one file.
- Remove strange comment

* Fix: Remove `dtolnay/rust-toolchain` from tests workflows.
- Remove rust override from sdist installation.

* Fix: Remove ubuntu docs dependencies installation in lint workflow
- Rename main tests to "Python Unit Tests", and other tests to "Rust Unit Tests" and "Image Comparison Tests".

* Fix: Install tox dependency in lint workflow

* Fix: Add missing circuit results

* Chore: Remove stale comment

* Fix: Remove architecture argument from mac tests

* Chore: Remove unused matrix from "on-merge-queue"

* Chore: Remove unused environment variables from "rust-tests".
- Remove stale comment.

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Fix: Streamline pull request resting
- Use matrix for 3.9 tests
- Remove stale comment.

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Fix: Add missing stestr history filter step

* Fix: Add missing copy and publish images step for "test-linux"

* Update .github/workflows/on-push.yml

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Fix: Use perl instead of grep for mac
- Remove `set -e` from Windows.

* Fix: Add different name to each copied images name.

* Fix: Errors in new stestr filtering step
- Remove redundant popd after test runs on runs from source.
- Remove cp step from filtering stestr step.

* Fix: Rervert command to the one used in old workflow for mac.

* Fix: Add missing path in image tests.

* Chore: Remove usage of `actions/setup-pythoh.id`

* Fix: Add missing `pip check` on "test_mac"

* Fix: "on-merge" names now match "on-pull-request" names

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
rahaman-quantum pushed a commit to rahaman-quantum/qiskit that referenced this pull request Jun 20, 2025
* Integrate C API tests into new GHA workflow structure

In Qiskit#13474 we restructured our CI to be based solely on github actions.
As part of that change a new workflow structure was introduced where
there were `on-*.yml` files that enumerate the jobs run for each job
trigger. For example, `on-pull-request.yml` lists all the jobs that run
when a pull request is opened or updated. However, the C API tests were
not integrated into this new structure as part of Qiskit#13474 as they were
already running and that PR didn't want to change github actions usage
that was already working. This commit is the follow up that updates the
C API tests so they fit into the new structure and the jobs that are run
are listed in the specific trigger sections.

* Fix broken syntax

---------

Co-authored-by: Jake Lishman <jake@binhbar.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate CI to github actions
4 participants