Build & Test Python Wheel Package #106
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: Build & Test Python Wheel Package | |
| on: | |
| push: | |
| paths: | |
| - "src/**" | |
| - "tests/**" | |
| - ".github/workflows/*" | |
| - "pyproject.toml" | |
| schedule: | |
| - cron: "30 23 * * 0" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| - name: Display Python version | |
| run: python -c "import sys; print(sys.version)" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| python -m pip install qiskit qiskit-ibm-runtime | |
| - name: Generate wheel package | |
| run: python -m pip wheel -w wheel . | |
| - name: Upload wheel package | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: wheel-pkg | |
| path: wheel/qiskit_leaky_scheduling*.whl | |
| if-no-files-found: error | |
| retention-days: 1 | |
| overwrite: true | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| sparse-checkout: | | |
| tests | |
| HSLU_Logo_small.png | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Display Python version | |
| run: python -c "import sys; print(sys.version)" | |
| - name: Download wheel package | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: wheel-pkg | |
| - name: List files working directory | |
| run: ls -alR | |
| - name: Install wheel package | |
| run: python -m pip install *.whl | |
| - name: Run tests | |
| run: python -m unittest discover tests | |