Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
486abfb
ci: Comprehensive CI infrastructure modernization
bernalde Oct 29, 2025
be8661e
ci: test pip install from SECQUOIA GitHub repo in main test workflow
bernalde Oct 29, 2025
86e443d
fix: ensure correct argument types for get_log_omega in partition_fun…
bernalde Oct 29, 2025
d2b72c7
ci: revert to local editable install for testing (pip install -e .)
bernalde Oct 29, 2025
e0baef4
style: format get_log_omega call for improved readability
bernalde Oct 29, 2025
dadd88f
chore: add initial pyproject.toml for project configuration
bernalde Oct 29, 2025
2ac1fee
chore: add toml dependency for YAPF configuration
bernalde Oct 29, 2025
29d802f
fix: add toml dependency to ci.yml lint job for YAPF configuration
bernalde Nov 10, 2025
07ad5f7
test: add comprehensive tests for AIS partition function calculations
bernalde Nov 11, 2025
c3a0505
fix: correct critical indentation bug in partition_function_post
bernalde Nov 11, 2025
ae902bd
chore: add coverage and pytest artifacts to .gitignore
bernalde Nov 11, 2025
4e9a901
fix: add CODECOV_TOKEN to all codecov upload actions
bernalde Nov 11, 2025
d03e6f0
fix: remove pytest from runtime dependencies
bernalde Nov 11, 2025
9520e98
perf: use coverage report instead of re-running pytest for summary
bernalde Nov 11, 2025
ee3d1c0
refactor: remove redundant numpy import in partition_function_post
bernalde Nov 11, 2025
d2f2438
fix: use raw strings for docstrings with LaTeX escape sequences
bernalde Nov 11, 2025
a58ee99
fix: typo in README (envinronment → environment)
bernalde Nov 11, 2025
1891816
style: apply YAPF formatting to test_ais.py and ais.py
bernalde Nov 11, 2025
83b83f6
docs: move pytest from core to CI-specific dependencies in documentation
bernalde Nov 11, 2025
cd2f6ea
docs: add missing entries for bug fixes and test coverage in CHANGELOG
bernalde Nov 11, 2025
3ab3168
refactor: use variable n to create states in test_partition_function_…
bernalde Nov 11, 2025
4bf67bb
Merge pull request #1 from SECQUOIA/ci-testing
bernalde Nov 11, 2025
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
87 changes: 87 additions & 0 deletions .github/ISSUE_TEMPLATE/ci_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI/Build Issue
description: Report a problem with continuous integration or build processes
title: "[CI]: "
labels: ["ci", "infrastructure"]
body:
- type: markdown
attributes:
value: |
Thanks for reporting a CI/build issue. Please provide as much detail as possible.

- type: dropdown
id: workflow
attributes:
label: Which workflow is affected?
options:
- CI (ci.yml)
- Python PyTest (python-pytest.yml)
- Code Formatting (python-yapf.yml)
- Examples (python-example.yml)
- Tutorials (python-tutorials.yml)
- Code Coverage (coverage.yml)
- PR Comment (pr-comment.yml)
- Other
validations:
required: true

- type: input
id: workflow-run
attributes:
label: Workflow Run URL
description: Link to the failed workflow run
placeholder: https://github.com/SECQUOIA/PySA/actions/runs/...
validations:
required: false

- type: dropdown
id: python-version
attributes:
label: Python Version
options:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- All versions
- Not applicable
validations:
required: false

- type: textarea
id: description
attributes:
label: Description
description: What happened? What did you expect to happen?
placeholder: Describe the CI issue...
validations:
required: true

- type: textarea
id: logs
attributes:
label: Relevant Log Output
description: Please copy and paste any relevant log output from the workflow
render: shell
validations:
required: false

- type: textarea
id: steps
attributes:
label: Steps to Reproduce
description: How can we reproduce this issue locally?
placeholder: |
1. Run command '...'
2. See error '...'
validations:
required: false

- type: checkboxes
id: checklist
attributes:
label: Checklist
options:
- label: I have checked the CI documentation (docs/CI_INFRASTRUCTURE.md)
- label: I have verified this issue exists on the latest commit
- label: I have checked existing issues for duplicates
45 changes: 45 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Description
<!-- Provide a brief description of the changes in this PR -->

## Type of Change
<!-- Mark the relevant option with an "x" -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] CI/Infrastructure update
- [ ] Performance improvement
- [ ] Code refactoring

## Related Issues
<!-- Link to related issues using #issue_number -->
Closes #

## Changes Made
<!-- Describe the changes in detail -->
-
-
-

## Testing
<!-- Describe how you tested these changes -->
- [ ] Unit tests pass locally (`pytest tests/`)
- [ ] Code follows style guidelines (`yapf --style=google -d -r .`)
- [ ] Added tests for new functionality
- [ ] All examples run successfully
- [ ] Tutorials execute without errors (if applicable)
- [ ] Documentation updated (if needed)

## Checklist
<!-- Mark completed items with an "x" -->
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published

## Additional Notes
<!-- Add any additional notes, context, or screenshots -->
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: 2
updates:
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "ci"
include: "scope"

# Python dependencies
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 10
labels:
- "dependencies"
- "python"
commit-message:
prefix: "deps"
include: "scope"
ignore:
# Ignore major version updates for stable dependencies
- dependency-name: "numpy"
update-types: ["version-update:semver-major"]
- dependency-name: "scipy"
update-types: ["version-update:semver-major"]
178 changes: 178 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
name: CI

on:
push:
branches: [ main, ci-testing ]
pull_request:
branches: [ main ]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Code Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Install yapf
run: |
python -m pip install --upgrade pip
pip install yapf==0.32.0
pip install toml

- name: Check format with YAPF
run: |
yapf --style=google -d -r .

test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e . pytest pytest-cov pytest-xdist

- name: Run tests
run: |
pytest -rA -n auto --cov=pysa --cov-report=xml --cov-report=term tests/

- name: Upload coverage to artifact
if: matrix.python-version == '3.11'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.xml
retention-days: 7

coverage:
name: Upload Coverage
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4

- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage-report

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
continue-on-error: true

examples:
name: Examples Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
needs: test
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.11"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e . termplotlib

- name: Run examples
run: |
python examples/example_ising.py
python examples/example_qubo.py
python examples/example_ais.py

tutorials:
name: Tutorials Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
needs: test
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.11"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e . papermill matplotlib plotly jupyter hyperopt torch torchvision

- name: Run tutorials
run: |
cd tutorials/
papermill example_ising.ipynb output_example_ising.ipynb || true
papermill hpo_demo.ipynb output_hpo_demo.ipynb || true
papermill ising_tutorial.ipynb output_ising_tutorial.ipynb || true
papermill RBM_tutorial.ipynb output_RBM_tutorial.ipynb || true

- name: Upload tutorial outputs
if: always()
uses: actions/upload-artifact@v4
with:
name: tutorial-outputs-py${{ matrix.python-version }}
path: tutorials/output_*.ipynb
retention-days: 7
continue-on-error: true

all-checks-passed:
name: All Checks Passed
needs: [lint, test, examples, tutorials]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check if all jobs passed
run: |
if [[ "${{ needs.lint.result }}" != "success" ]] || \
[[ "${{ needs.test.result }}" != "success" ]] || \
[[ "${{ needs.examples.result }}" != "success" ]] || \
[[ "${{ needs.tutorials.result }}" != "success" ]]; then
echo "One or more jobs failed"
exit 1
fi
echo "All checks passed successfully!"
Loading