-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workflows/tests: build packages separately
- Loading branch information
Showing
1 changed file
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,18 +9,34 @@ on: | |
env: | ||
PYTHONIOENCODING: utf-8 | ||
jobs: | ||
package-tests: | ||
name: tests-${{ matrix.os }}-py${{ matrix.python-version }}-qiskit${{ matrix.qiskit-version }} | ||
build-packages: | ||
name: build-packages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
- name: Build packages | ||
run: | | ||
pip install hatch | ||
hatch build | ||
- name: Store packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: packages | ||
path: dist/ | ||
examples: | ||
needs: build-packages | ||
name: examples-${{ matrix.os }}-py${{ matrix.python-version }}-qiskit${{ matrix.qiskit-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
qiskit-version: ['0.46.0', '1.0.1'] | ||
python-version: ['3.12'] | ||
os: ["ubuntu-latest"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Check shell scripts | ||
uses: ludeeus/[email protected] | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
|
@@ -31,10 +47,10 @@ jobs: | |
# https://github.com/astral-sh/uv/issues/1386#issuecomment-1947801083 | ||
echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV | ||
pip install uv | ||
- name: Build package | ||
run: | | ||
uv pip install hatch | ||
hatch build | ||
- name: Restore packages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: packages | ||
- name: Install package wheel | ||
run: | | ||
# there is only one wheel in dist/ | ||
|
@@ -43,6 +59,18 @@ jobs: | |
- name: Run examples | ||
run: | | ||
./examples/run_all.sh | ||
# tests: | ||
# name: tests-${{ matrix.os }}-py${{ matrix.python-version }}-qiskit${{ matrix.qiskit-version }} | ||
# runs-on: ${{ matrix.os }} | ||
# strategy: | ||
# matrix: | ||
# qiskit-version: ['0.46.0', '1.0.1'] | ||
# python-version: ['3.12'] | ||
# os: ['ubuntu-latest'] | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Check shell scripts | ||
# uses: ludeeus/[email protected] | ||
# - name: Lock | ||
# run: poetry install --sync | ||
# - name: Check version numbers consistency | ||
|