From 689fd4e5e1969bb395dbbb27edaa184a62f1b5df Mon Sep 17 00:00:00 2001 From: Stuart Prescott Date: Sun, 8 Dec 2024 14:03:01 +0000 Subject: [PATCH] Build sibling projects only once on CI --- .github/workflows/ci.yml | 48 +++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b746bf6b71..248247d726 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,8 +45,40 @@ jobs: - id: set-matrix run: python .github/workflows/matrix.py >> $GITHUB_OUTPUT + + builddeps: + runs-on: ubuntu-latest + + strategy: + matrix: + package: [ + ["sasdata", "git+https://github.com/llimeht/sasdata.git@tmp/pyproject"], + ["sasmodels", "git+https://github.com/llimeht/sasmodels.git@tmp/pyproject"], + ["bumps", "git+https://github.com/llimeht/bumps.git@tmp/docs-source"], + ] + + steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + ### Installation of some build-dependencies + + - name: Build wheel of ${{ matrix.package[0] }} + run: | + python -m pip wheel --verbose ${{ matrix.package[1] }} + + - name: Store wheel for use + uses: actions/upload-artifact@v4 + with: + name: sasview-wheel-${{ matrix.package[0] }} + path: | + *whl + if-no-files-found: ignore + build-matrix: - needs: [matrix] + needs: [matrix, builddeps] strategy: fail-fast: false @@ -85,14 +117,18 @@ jobs: - name: Install Python dependencies run: | python -m pip install -r build_tools/requirements.txt - python -m pip install build hatchling hatch-build-scripts hatch-requirements-txt hatch-vcs - python -m pip install git+https://github.com/llimeht/hatch-sphinx.git + python -m pip install build hatchling hatch-build-scripts hatch-requirements-txt hatch-vcs hatch-sphinx + + - name: Fetch wheels of sibling projects + uses: actions/download-artifact@v4 + with: + path: dist/ + pattern: sasview-wheel-* + merge-multiple: true - name: Install correct versions of sibling projects run: | - python -m pip install --no-build-isolation --verbose git+https://github.com/llimeht/sasdata.git@tmp/pyproject - python -m pip install --no-build-isolation --verbose git+https://github.com/llimeht/sasmodels.git@tmp/pyproject - python -m pip install --no-build-isolation --verbose git+https://github.com/llimeht/bumps.git@tmp/docs-source + python -m pip install dist/*whl - name: Install pywin32 (Windows) if: ${{ startsWith(matrix.os, 'windows') }}