Skip to content

Commit f94c261

Browse files
committed
workflows/tests: build packages separately
1 parent b612974 commit f94c261

File tree

1 file changed

+43
-10
lines changed

1 file changed

+43
-10
lines changed

.github/workflows/tests.yml

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,73 @@ on:
99
env:
1010
PYTHONIOENCODING: utf-8
1111
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 }}
1433
runs-on: ${{ matrix.os }}
1534
strategy:
1635
matrix:
1736
qiskit-version: ['0.46.0', '1.0.1']
1837
python-version: ['3.12']
1938
os: ["ubuntu-latest"]
2039
steps:
21-
- uses: actions/checkout@v4
22-
- name: Check shell scripts
23-
uses: ludeeus/[email protected]
2440
- name: Set up Python ${{ matrix.python-version }}
2541
uses: actions/setup-python@v5
2642
with:
2743
python-version: ${{ matrix.python-version }}
28-
cache: "pip"
2944
- name: Install uv
3045
run: |
3146
# https://github.com/astral-sh/uv/issues/1386#issuecomment-1947801083
3247
echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV
3348
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
3853
- name: Install package wheel
3954
run: |
4055
# there is only one wheel in dist/
4156
echo "qiskit==${{ matrix.qiskit-version }}" > override.txt
4257
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
4364
- name: Run examples
4465
run: |
4566
./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+
# uses: ludeeus/[email protected]
4679
# - name: Lock
4780
# run: poetry install --sync
4881
# - name: Check version numbers consistency

0 commit comments

Comments
 (0)