Elaborate Tests #116
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: Elaborate Tests | |
| on: | |
| pull_request: | |
| types: [review_requested] | |
| schedule: | |
| - cron: '23 1 * * *' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${ | |
| (github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name) | |
| } | |
| cancel-in-progress: true | |
| jobs: | |
| pytest_minimal_requirements: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: | | |
| python -m venv venv_minimal | |
| source venv_minimal/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install toml autoray==0.7.2 matplotlib-inline==0.1.7 | |
| python3 install_lowest_dependencies.py | |
| - name: Test with pytest | |
| run: | | |
| source venv_minimal/bin/activate | |
| pip install pytest | |
| pytest tests/ | |
| - name: clean | |
| run: | | |
| rm -rf venv_minimal | |
| pytest_qiskit_0_46: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: | | |
| python -m venv venv_qiskit_0_46 | |
| source venv_qiskit_0_46/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install . qiskit==0.46.3 qiskit-ibm-runtime==0.20.0 autoray==0.7.2 | |
| - name: Test with pytest | |
| run: | | |
| source venv_qiskit_0_46/bin/activate | |
| pip install pytest | |
| pytest tests/ | |
| - name: clean | |
| run: | | |
| rm -rf venv_qiskit_0_46 | |
| pytest_qiskit_1: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: | | |
| python -m venv venv_qiskit_1 | |
| source venv_qiskit_1/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install . qiskit==1.1.2 qiskit-algorithms==0.3.0 qiskit-ibm-runtime==0.27.1 autoray==0.7.2 | |
| - name: Test with pytest | |
| run: | | |
| source venv_qiskit_1/bin/activate | |
| pip install pytest | |
| pytest tests/ | |
| - name: clean | |
| run: | | |
| rm -rf venv_qiskit_1 | |
| pytest_full: | |
| name: Tests + Examples on ubuntu-latest with Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: | | |
| ${{ | |
| matrix.python-version | |
| }} | |
| - name: Install dependencies | |
| run: | | |
| python -m venv venv_latest | |
| source venv_latest/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install .[examples] | |
| - name: Install old autoray | |
| if: matrix.python-version == '3.9' | |
| run: | | |
| source venv_latest/bin/activate | |
| pip install autoray==0.7.2 | |
| - name: Test with pytest | |
| run: | | |
| source venv_latest/bin/activate | |
| pip install pytest | |
| pytest tests/ | |
| - name: Test examples | |
| run: | | |
| source venv_latest/bin/activate | |
| pip install nbmake | |
| pytest --nbmake --nbmake-timeout 600 examples/ | |
| - name: clean | |
| run: | | |
| rm -rf venv_latest | |
| pytest_windows: | |
| name: Test on windows-latest with Python ${{ matrix.python-version }} | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: | | |
| ${{ | |
| matrix.python-version | |
| }} | |
| - name: Install dependencies | |
| run: | | |
| python -m venv venv_latest | |
| .\venv_latest\Scripts\python.exe -m pip install --upgrade pip | |
| .\venv_latest\Scripts\pip.exe install . | |
| - name: Install old autoray | |
| if: matrix.python-version == '3.9' | |
| run: | | |
| .\venv_latest\Scripts\pip.exe install autoray==0.7.2 | |
| - name: Test with pytest | |
| run: | | |
| .\venv_latest\Scripts\pip.exe install pytest | |
| .\venv_latest\Scripts\pytest.exe tests/ | |
| - name: clean | |
| run: | | |
| rm -Recurse -Force venv_latest | |
| pytest_macos: | |
| name: Test on macos-latest with Python ${{ matrix.python-version }} | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: | | |
| ${{ | |
| matrix.python-version | |
| }} | |
| - name: Install dependencies | |
| run: | | |
| python -m venv venv_latest | |
| source venv_latest/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install . | |
| - name: Install old autoray | |
| if: matrix.python-version == '3.9' | |
| run: | | |
| source venv_latest/bin/activate | |
| pip install autoray==0.7.2 | |
| - name: Test with pytest | |
| run: | | |
| source venv_latest/bin/activate | |
| pip install pytest | |
| pytest tests/ | |
| - name: clean | |
| run: | | |
| rm -rf venv_latest |