Skip to content
Closed
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
57 changes: 45 additions & 12 deletions .github/workflows/Test-CI-dev-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,18 @@ jobs:
runs-on: ubuntu-latest

steps:
#
# Setup Repository
#
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Debug
run: git status

- name: Install dependencies
run: |
set -e
python -m pip install -U pip
python -m pip install --extra-index-url https://pypi.org/simple --pre -U -r requirements.txt
python -m pip install --extra-index-url https://pypi.org/simple -U -r requirements_tests.txt

#
# Setup Environment
#
# Configure AWS credentials
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
Expand All @@ -54,6 +48,45 @@ jobs:
IS_DEV: "true"
M2M_SECRET_ARN: "${{ secrets.NIGHTLY_M2M_SECRET_ARN }}"

#
# Setup Python
# (needs to run after "Setup Environment", since we install classiq's version from aws)
#
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
run: |
# Some weird behavior, that we should understand soon:
# "pip" defaults to use the aws url, and doesn't use the normal url
# so we need to add the normal pip url to every line..
set -e

python -m pip install -U pip \
--extra-index-url https://pypi.org/simple

# Install "classiq" separately
export CODEARTIFACT_AUTH_TOKEN="$( \
aws codeartifact get-authorization-token \
--domain ${{ secrets.CODEARTIFACT_DOMAIN }} \
--domain-owner ${{ secrets.CODEARTIFACT_OWNER }} \
--region ${{ secrets.CODEARTIFACT_REGION }} \
--query authorizationToken \
--output text \
)"
python -m pip install -U --pre \
--extra-index-url "https://aws:$CODEARTIFACT_AUTH_TOKEN@${{ secrets.CODEARTIFACT_DOMAIN }}-${{ secrets.CODEARTIFACT_OWNER }}.d.codeartifact.${{ secrets.CODEARTIFACT_REGION }}.amazonaws.com/pypi/${{ secrets.PYPI_NIGHTLY_NAME }}/simple/" \
--extra-index-url https://pypi.org/simple \
classiq

# Install everything from the requirements, other than "classiq".
python -m pip install -U $(grep -ivE "classiq" requirements.txt) \
--extra-index-url https://pypi.org/simple
python -m pip install -U -r requirements_tests.txt \
--extra-index-url https://pypi.org/simple

# Run Notebook Tests
- name: Run Notebooks
run: python -m pytest --log-cli-level=INFO tests
Expand Down
57 changes: 40 additions & 17 deletions .github/workflows/Test-CI-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,6 @@ jobs:
echo "==== Git status after checkout ===="
git status

#
# Setup Python
#
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true'
run: |
set -e
python -m pip install -U pip
# The `--pre` allows the installation of pre-release versions of packages (needed for Dev)
python -m pip install --extra-index-url https://pypi.org/simple --pre -U -r requirements.txt
python -m pip install --extra-index-url https://pypi.org/simple -U -r requirements_tests.txt

#
# Setup Environment
#
Expand All @@ -108,6 +91,46 @@ jobs:
IS_DEV: "true"
M2M_SECRET_ARN: "${{ secrets.NIGHTLY_M2M_SECRET_ARN }}"

#
# Setup Python
# (needs to run after "Setup Environment", since we install classiq's version from aws)
#
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true'
run: |
# Some weird behavior, that we should understand soon:
# "pip" defaults to use the aws url, and doesn't use the normal url
# so we need to add the normal pip url to every line..
set -e

python -m pip install -U pip \
--extra-index-url https://pypi.org/simple

# Install "classiq" separately
export CODEARTIFACT_AUTH_TOKEN="$( \
aws codeartifact get-authorization-token \
--domain ${{ secrets.CODEARTIFACT_DOMAIN }} \
--domain-owner ${{ secrets.CODEARTIFACT_OWNER }} \
--region ${{ secrets.CODEARTIFACT_REGION }} \
--query authorizationToken \
--output text \
)"
python -m pip install -U --pre \
--extra-index-url "https://aws:$CODEARTIFACT_AUTH_TOKEN@${{ secrets.CODEARTIFACT_DOMAIN }}-${{ secrets.CODEARTIFACT_OWNER }}.d.codeartifact.${{ secrets.CODEARTIFACT_REGION }}.amazonaws.com/pypi/${{ secrets.PYPI_NIGHTLY_NAME }}/simple/" \
--extra-index-url https://pypi.org/simple \
classiq

# Install everything from the requirements, other than "classiq".
python -m pip install -U $(grep -ivE "classiq" requirements.txt) \
--extra-index-url https://pypi.org/simple
python -m pip install -U -r requirements_tests.txt \
--extra-index-url https://pypi.org/simple

#
# Propagate CI information to python tests
#
Expand Down
45 changes: 45 additions & 0 deletions test.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "3d0f10c2-79f2-401d-b5c1-49d23723af11",
"metadata": {},
"outputs": [],
"source": [
"from classiq import *\n",
"\n",
"\n",
"@qfunc\n",
"def main(x: Output[QBit]):\n",
" allocate(1, x)\n",
" X(x)\n",
"\n",
"\n",
"qmod = create_model(main, preferences=Preferences(optimization_level=0))\n",
"qprog = synthesize(qmod)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
1 change: 1 addition & 0 deletions tests/resources/timeouts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,4 @@ pennylane_cat_qsvt_example.ipynb: 100
qiskit_qsvt.ipynb: 100
pennylane_catalyst_discrete_quantum_walk.ipynb: 100
tket_qsvt_example.ipynb: 100
test.ipynb: 100
Loading
Loading