Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions .github/workflows/_build-non-pure-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: Build wheel and sdist for a non-pure Python package

on:
workflow_call:

jobs:
build_sdist:
defaults:
run:
shell: bash -l {0}

name: Build sdist
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: sdist
channels: conda-forge
auto-update-conda: true
auto-activate-base: false
python-version: 3.13

- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no

- name: Build sdist
run: |
pip install --upgrade build
python -m build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: ./dist/*.tar.gz

build-wheels:
needs: [build_sdist]
defaults:
run:
shell: bash -l {0}

name: cibw-wheels-${{ matrix.python }}-${{ matrix.buildplat }}
runs-on: ${{ matrix.buildplat }}
strategy:
fail-fast: false
matrix:
buildplat:
- ubuntu-latest
- macos-13
- macos-14
- windows-latest
python:
- "3.11"
- "3.12"
- "3.13"

steps:
- name: Check out
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: build
channels: conda-forge
auto-update-conda: true
auto-activate-base: false
python-version: ${{ matrix.python }}

- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no

- name: Install requirements
run: |
conda install --file requirements/conda.txt
conda install --file requirements/pip.txt
pip install --upgrade build
python -m pip wheel --no-deps --wheel-dir ./dist .

- name: Upload wheels to GitHub
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.python }}-${{ matrix.buildplat }}.whl
path: ./dist/*.whl

test-wheels:
needs: [build-wheels]
defaults:
run:
shell: bash -l {0}

name: test-wheels-${{ matrix.python }}-${{ matrix.buildplat }}
runs-on: ${{ matrix.buildplat }}
strategy:
fail-fast: false
matrix:
buildplat:
- ubuntu-latest
- macos-13
- macos-14
- windows-latest
python:
- "3.11"
- "3.12"
- "3.13"

steps:
- name: Check out
uses: actions/checkout@v4

- name: Download wheels
uses: actions/download-artifact@v4
with:
name: ${{ matrix.python }}-${{ matrix.buildplat }}.whl
path: ./dist

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
channels: conda-forge
auto-update-conda: true
auto-activate-base: false
python-version: ${{ matrix.python }}

- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no

- name: Install requirements
run: |
conda install --file requirements/conda.txt
conda install --file requirements/tests.txt

- name: Install wheel and test
run: |
pip install ./dist/*.whl
pytest
100 changes: 0 additions & 100 deletions .github/workflows/_build-pdffit2-package.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/_build-wheel-release-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:

build-non-pure-python-package:
needs: [tag-privilege-check]
if: inputs.project == 'diffpy.pdffit2' || inputs.project == 'diffpy.srreal' || inputs.project == 'pyobjcryst'
uses: ./.github/workflows/_build-pdffit2-package.yml
if: inputs.c_extension
uses: ./.github/workflows/_build-non-pure-package.yml

update-changelog:
# The always() function is necessary to ensure that we wait for both build jobs to complete, even if one of them is skipped.
Expand Down
Loading