Skip to content

Commit

Permalink
workflows/tests: build packages separately
Browse files Browse the repository at this point in the history
  • Loading branch information
airwoodix committed Feb 23, 2024
1 parent b612974 commit b79bb46
Showing 1 changed file with 37 additions and 9 deletions.
46 changes: 37 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/
Expand All @@ -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
Expand Down

0 comments on commit b79bb46

Please sign in to comment.