-
Notifications
You must be signed in to change notification settings - Fork 0
Comprehensive CI infrastructure modernization and enhancements #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
486abfb
ci: Comprehensive CI infrastructure modernization
bernalde be8661e
ci: test pip install from SECQUOIA GitHub repo in main test workflow
bernalde 86e443d
fix: ensure correct argument types for get_log_omega in partition_fun…
bernalde d2b72c7
ci: revert to local editable install for testing (pip install -e .)
bernalde e0baef4
style: format get_log_omega call for improved readability
bernalde dadd88f
chore: add initial pyproject.toml for project configuration
bernalde 2ac1fee
chore: add toml dependency for YAPF configuration
bernalde 29d802f
fix: add toml dependency to ci.yml lint job for YAPF configuration
bernalde 07ad5f7
test: add comprehensive tests for AIS partition function calculations
bernalde c3a0505
fix: correct critical indentation bug in partition_function_post
bernalde ae902bd
chore: add coverage and pytest artifacts to .gitignore
bernalde 4e9a901
fix: add CODECOV_TOKEN to all codecov upload actions
bernalde d03e6f0
fix: remove pytest from runtime dependencies
bernalde 9520e98
perf: use coverage report instead of re-running pytest for summary
bernalde ee3d1c0
refactor: remove redundant numpy import in partition_function_post
bernalde d2f2438
fix: use raw strings for docstrings with LaTeX escape sequences
bernalde a58ee99
fix: typo in README (envinronment → environment)
bernalde 1891816
style: apply YAPF formatting to test_ais.py and ais.py
bernalde 83b83f6
docs: move pytest from core to CI-specific dependencies in documentation
bernalde cd2f6ea
docs: add missing entries for bug fixes and test coverage in CHANGELOG
bernalde 3ab3168
refactor: use variable n to create states in test_partition_function_…
bernalde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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!" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.