Skip to content

Commit f0400bd

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

File tree

1 file changed

+44
-10
lines changed

1 file changed

+44
-10
lines changed

.github/workflows/tests.yml

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,74 @@ 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
53+
path: dist
3854
- name: Install package wheel
3955
run: |
4056
# there is only one wheel in dist/
4157
echo "qiskit==${{ matrix.qiskit-version }}" > override.txt
4258
uv pip install --strict --override override.txt "qiskit-aqt-provider[examples] @ $(ls dist/*.whl)"
59+
- name: Checkout examples
60+
uses: actions/checkout@v4
61+
with:
62+
sparse-checkout: |
63+
examples
64+
sparse-checkout-cone-mode: false
4365
- name: Run examples
4466
run: |
4567
./examples/run_all.sh
68+
# tests:
69+
# name: tests-${{ matrix.os }}-py${{ matrix.python-version }}-qiskit${{ matrix.qiskit-version }}
70+
# runs-on: ${{ matrix.os }}
71+
# strategy:
72+
# matrix:
73+
# qiskit-version: ['0.46.0', '1.0.1']
74+
# python-version: ['3.12']
75+
# os: ['ubuntu-latest']
76+
# steps:
77+
# - uses: actions/checkout@v4
78+
# - name: Check shell scripts
79+
# uses: ludeeus/[email protected]
4680
# - name: Lock
4781
# run: poetry install --sync
4882
# - name: Check version numbers consistency

0 commit comments

Comments
 (0)