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

CI/CD Updates and Fixes #235

Merged
merged 10 commits into from
Mar 26, 2024
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
31 changes: 31 additions & 0 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Runs slow tests every night
name: nightly tests

on:
schedule:
- cron: "21 2 * * *"

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.12

- name: Upgrade python environment
run: python -m pip install --upgrade virtualenv setuptools pip

- name: Upgrade test dependencies
run: python -m pip install psutil pytest 'hypothesis[zoneinfo]' qiskit

- name: Install BQSKit
env:
SYSTEM_VERSION_COMPAT: 0
run: pip install .

- name: Run tests
env:
NUMBER_RANDOM_CIRCUITS: 100
run: pytest
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/publish-on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish Release
on:
release:

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install build tool
run: python -m pip install build --user

- name: Build distribution packages
run: python -m build

- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Upload release to PyPI

needs:
- build

runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/bqskit

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
16 changes: 7 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,23 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade python environment
run: python -m pip install --upgrade virtualenv setuptools pip

- name: Upgrade test dependencies
run: python -m pip install psutil pytest 'hypothesis[zoneinfo]'

- name: Upgrade optional test dependencies
if: matrix.python-version != '3.12'
run: python -m pip install qiskit
run: python -m pip install psutil pytest 'hypothesis[zoneinfo]' qiskit

- name: Install BQSKit
env:
SYSTEM_VERSION_COMPAT: 0
NUMBER_RANDOM_CIRCUITS: 100
run: pip install .

- name: Run tests
run: pytest
env:
NUMBER_RANDOM_CIRCUITS: 100
run: pytest --ignore=tests/compiler/compile --ignore=tests/passes/partitioning/test_parts.py --ignore=tests/passes/synthesis/test_qfast.py
2 changes: 0 additions & 2 deletions bqskit/passes/processing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from bqskit.passes.processing.exhaustive import ExhaustiveGateRemovalPass
from bqskit.passes.processing.iterative import IterativeScanningGateRemovalPass
from bqskit.passes.processing.rebase import Rebase2QuditGatePass # TODO: Remove
from bqskit.passes.processing.scan import ScanningGateRemovalPass
from bqskit.passes.processing.substitute import SubstitutePass

Expand All @@ -12,5 +11,4 @@
'IterativeScanningGateRemovalPass',
'ScanningGateRemovalPass',
'SubstitutePass',
'Rebase2QuditGatePass',
]
13 changes: 0 additions & 13 deletions bqskit/passes/processing/rebase.py

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
packages=find_packages(exclude=['examples*', 'test*']),
install_requires=[
'bqskitrs>=0.4.1',
'lark-parser',
'lark',
'numpy>=1.22.0',
'scipy>=1.8.0',
'typing-extensions>=4.0.0',
Expand Down
Loading