Fix the dockerfile of nv gpu #28
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: Educational Examples CI | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.11', '3.12'] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install core dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r examples/requirements.txt | |
| - name: Test example imports and basic functionality | |
| env: | |
| MPLBACKEND: Agg # Use non-interactive matplotlib backend | |
| run: | | |
| # Test essential imports work | |
| python -c "import sys; sys.path.append('examples'); import utils.visualization; print('✅ Utils import successful')" | |
| # Test key examples can run with minimal parameters | |
| echo "🧪 Testing Module 1 (Fundamentals)..." | |
| timeout 30s python examples/module1_fundamentals/01_classical_vs_quantum_bits.py --shots 5 || echo "⚠️ Module 1 timeout (expected for educational content)" | |
| echo "🧪 Testing CLI interfaces..." | |
| python examples/module1_fundamentals/01_classical_vs_quantum_bits.py --help > /dev/null | |
| python examples/module4_algorithms/01_deutsch_jozsa_algorithm.py --help > /dev/null | |
| echo "✅ Core functionality verified" | |
| documentation: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Validate project structure | |
| run: | | |
| echo "📚 Checking documentation structure..." | |
| # Check essential documentation exists | |
| test -f README.md && echo "✅ Main README found" | |
| test -f examples/README.md && echo "✅ Examples README found" | |
| # Count examples across modules | |
| total_examples=$(find examples/module*/ -maxdepth 1 -name "*.py" | wc -l) | |
| echo "📊 Found $total_examples example files" | |
| # Basic structure validation (flexible for educational content) | |
| if [ "$total_examples" -lt 40 ]; then | |
| echo "⚠️ Warning: Expected ~45 examples, found $total_examples" | |
| else | |
| echo "✅ Example count looks good: $total_examples examples" | |
| fi | |
| echo "✅ Documentation structure validated" |