-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Migrate CI to Github Actions #13474
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
Migrate CI to Github Actions #13474
Conversation
19bce30
to
fb398bb
Compare
Pull Request Test Coverage Report for Build 15215061156Warning: 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
💛 - Coveralls |
74a0fe4
to
ba1a164
Compare
ebc3e6e
to
e0c9a46
Compare
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 :) |
One or more of the following people are relevant to this code:
|
- Added `depth: 0` to checkout to avoid reno bugs.
- Rename `tests-linux.yml` to `test-linux.yml`.
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
- Remove `set -e` from Windows.
- Remove redundant popd after test runs on runs from source. - Remove cp step from filtering stestr step.
name: image-test-failure-img-diffs | ||
path: | | ||
./test/visual/mpl/graph/graph_results | ||
./test/visual/mpl/circuit/circuit_results |
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 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 ` |
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.
I guess ` is the right syntax on windows cmd/powershell for the bash equivalent of \
? I didn't realize that
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.
Yeah, apparently this is the powershell syntax for continued line (source).
-r requirements.txt ` | ||
-r requirements-dev.txt ` | ||
-e . | ||
pip check |
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 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).
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.
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.
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.
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.
* 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>
* 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>
* 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>
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:
New Pull Request workflow
The new PR workflow looks as such:

Where if both
Docs and Lint
andPreliminary 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
Run nightly matrix tests when code changes.Known issues
Main nightly tests should only run when new changes in the code are introduced (as per the previous azure workflow).