Skip to content

Commit

Permalink
Build sibling projects only once on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
llimeht committed Dec 8, 2024
1 parent 75fdc42 commit 689fd4e
Showing 1 changed file with 42 additions and 6 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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') }}
Expand Down

0 comments on commit 689fd4e

Please sign in to comment.