Add Docker support and remove deprecated CUDA Quantum files #123
Workflow file for this run
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
| name: Test Notebooks | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| discover: | |
| name: Discover notebooks | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| notebooks: ${{ steps.find-notebooks.outputs.notebooks }} | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Find all notebooks | |
| id: find-notebooks | |
| run: | | |
| echo "==================================================" | |
| echo "Discovering notebooks" | |
| echo "==================================================" | |
| notebooks=$(find . -name "*.ipynb" -type f -not -path "*/venv/*" | jq -R -s -c 'split("\n")[:-1]') | |
| echo "Found notebooks:" | |
| echo "$notebooks" | jq -r '.[]' | |
| echo "notebooks=$notebooks" >> $GITHUB_OUTPUT | |
| test: | |
| name: Test ${{ matrix.notebook }} | |
| needs: discover | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| notebook: ${{ fromJson(needs.discover.outputs.notebooks) }} | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "pyproject.toml" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies with uv | |
| run: | | |
| echo "==================================================" | |
| echo "Installing dependencies for ${{ matrix.notebook }}" | |
| echo "==================================================" | |
| start_time=$(date +%s) | |
| uv pip install --system -e . | |
| end_time=$(date +%s) | |
| elapsed=$((end_time - start_time)) | |
| echo "✓ Dependencies installed in ${elapsed}s" | |
| - name: Verify environment | |
| run: | | |
| echo "==================================================" | |
| echo "Verifying environment setup" | |
| echo "==================================================" | |
| echo "✓ Python version:" | |
| python --version | |
| echo "" | |
| echo "✓ uv version:" | |
| uv --version | |
| echo "" | |
| echo "✓ Installed packages:" | |
| uv pip list | grep -E "(jupyter|qiskit|cirq|pennylane|qbraid|cudaq)" || echo " (packages installed)" | |
| echo "" | |
| echo "✓ IONQ_API_KEY status:" | |
| if [ -n "$IONQ_API_KEY" ]; then | |
| echo " API key is set (length: ${#IONQ_API_KEY} characters)" | |
| else | |
| echo " WARNING: API key is not set!" | |
| fi | |
| env: | |
| IONQ_API_KEY: ${{ secrets.IONQ_API_KEY }} | |
| - name: Execute notebook | |
| run: | | |
| echo "==================================================" | |
| echo "Executing: ${{ matrix.notebook }}" | |
| echo "Timeout: 600s" | |
| echo "==================================================" | |
| start_time=$(date +%s) | |
| echo "Starting execution at $(date '+%Y-%m-%d %H:%M:%S')" | |
| python -m jupyter nbconvert \ | |
| --to html \ | |
| --execute \ | |
| --ExecutePreprocessor.timeout=600 \ | |
| "${{ matrix.notebook }}" | |
| exit_code=$? | |
| end_time=$(date +%s) | |
| elapsed=$((end_time - start_time)) | |
| if [ $exit_code -eq 0 ]; then | |
| echo "✓ PASSED in ${elapsed}s" | |
| echo "Completed at $(date '+%Y-%m-%d %H:%M:%S')" | |
| else | |
| echo "✗ FAILED after ${elapsed}s" | |
| exit $exit_code | |
| fi | |
| env: | |
| IONQ_API_KEY: ${{ secrets.IONQ_API_KEY }} | |
| - name: Upload execution artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: notebook-output-${{ hashFiles(matrix.notebook) }} | |
| path: | | |
| **/*.html | |
| retention-days: 7 | |
| summary: | |
| name: Test Summary | |
| needs: test | |
| runs-on: ubuntu-22.04 | |
| if: always() | |
| steps: | |
| - name: Summary | |
| run: | | |
| echo "==================================================" | |
| echo "Test Execution Complete" | |
| echo "==================================================" | |
| if [ "${{ needs.test.result }}" == "success" ]; then | |
| echo "✓ All notebook tests passed successfully!" | |
| else | |
| echo "✗ Some tests failed. Check individual job logs for details." | |
| exit 1 | |
| fi |