|
9 | 9 | env: |
10 | 10 | PYTHONIOENCODING: utf-8 |
11 | 11 | jobs: |
12 | | - package-tests: |
13 | | - name: tests-${{ matrix.os }}-py${{ matrix.python-version }}-qiskit${{ matrix.qiskit-version }} |
| 12 | + build-packages: |
| 13 | + name: build-packages |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + - name: Set up Python |
| 18 | + uses: actions/setup-python@v5 |
| 19 | + with: |
| 20 | + python-version: 3.12 |
| 21 | + - name: Build packages |
| 22 | + run: | |
| 23 | + pip install hatch |
| 24 | + hatch build |
| 25 | + - name: Store packages |
| 26 | + uses: actions/upload-artifact@v4 |
| 27 | + with: |
| 28 | + name: packages |
| 29 | + path: dist/ |
| 30 | + examples: |
| 31 | + needs: build-packages |
| 32 | + name: examples-${{ matrix.os }}-py${{ matrix.python-version }}-qiskit${{ matrix.qiskit-version }} |
14 | 33 | runs-on: ${{ matrix.os }} |
15 | 34 | strategy: |
16 | 35 | matrix: |
17 | 36 | qiskit-version: ['0.46.0', '1.0.1'] |
18 | 37 | python-version: ['3.12'] |
19 | 38 | os: ["ubuntu-latest"] |
20 | 39 | steps: |
21 | | - - uses: actions/checkout@v4 |
22 | | - - name: Check shell scripts |
23 | | - |
24 | 40 | - name: Set up Python ${{ matrix.python-version }} |
25 | 41 | uses: actions/setup-python@v5 |
26 | 42 | with: |
27 | 43 | python-version: ${{ matrix.python-version }} |
28 | | - cache: "pip" |
29 | 44 | - name: Install uv |
30 | 45 | run: | |
31 | 46 | # https://github.com/astral-sh/uv/issues/1386#issuecomment-1947801083 |
32 | 47 | echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV |
33 | 48 | pip install uv |
34 | | - - name: Build package |
35 | | - run: | |
36 | | - uv pip install hatch |
37 | | - hatch build |
| 49 | + - name: Restore packages |
| 50 | + uses: actions/download-artifact@v4 |
| 51 | + with: |
| 52 | + name: packages |
38 | 53 | - name: Install package wheel |
39 | 54 | run: | |
40 | 55 | # there is only one wheel in dist/ |
41 | 56 | echo "qiskit==${{ matrix.qiskit-version }}" > override.txt |
42 | 57 | uv pip install --strict --override override.txt "qiskit-aqt-provider[examples] @ $(ls dist/*.whl)" |
| 58 | + - name: Checkout examples |
| 59 | + uses: actions/checkout@v4 |
| 60 | + with: |
| 61 | + sparse-checkout: | |
| 62 | + examples |
| 63 | + sparse-checkout-cone-mode: false |
43 | 64 | - name: Run examples |
44 | 65 | run: | |
45 | 66 | ./examples/run_all.sh |
| 67 | + # tests: |
| 68 | + # name: tests-${{ matrix.os }}-py${{ matrix.python-version }}-qiskit${{ matrix.qiskit-version }} |
| 69 | + # runs-on: ${{ matrix.os }} |
| 70 | + # strategy: |
| 71 | + # matrix: |
| 72 | + # qiskit-version: ['0.46.0', '1.0.1'] |
| 73 | + # python-version: ['3.12'] |
| 74 | + # os: ['ubuntu-latest'] |
| 75 | + # steps: |
| 76 | + # - uses: actions/checkout@v4 |
| 77 | + # - name: Check shell scripts |
| 78 | + |
46 | 79 | # - name: Lock |
47 | 80 | # run: poetry install --sync |
48 | 81 | # - name: Check version numbers consistency |
|
0 commit comments