Skip to content

Commit

Permalink
Add source dist and wheel builds; save artifacts.
Browse files Browse the repository at this point in the history
This updates the `build_and_test.yaml` file to also
build source distributions (sdist), wheel files, and
to also save artifacts of those builds.
  • Loading branch information
Michael O'Keefe authored and Michael O'Keefe committed Nov 15, 2024
1 parent 1afacc2 commit 11b0162
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
include:
- os: ubuntu
platform: linux
- os: windows
ls: dir
runs-on: ${{ format('{0}-latest', matrix.os) }}
steps:
- uses: actions/checkout@v4
Expand All @@ -28,10 +33,46 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: install python dependencies
run: python -m pip install --upgrade pip setuptools wheel pytest
run: python -m pip install --upgrade pip setuptools wheel pytest twine cibuildwheel
- name: run cargo tests
run: cargo test
- name: install FASTSim python
run: pip install -e .[dev]
- name: run pytest
run: pytest -v
- name: build source distribution
if: matrix.os == 'ubuntu' && matrix.python-version == '3.10'
run: |
pip install -U setuptools-rust
python -c "import setuptools; setuptools.setup()" sdist
- name: build ${{ matrix.platform || matrix.os }} binaries
run: cibuildwheel --output-dir dist
env:
CIBW_BUILD: "cp3${{ matrix.python-version }}-*"
CIBW_SKIP: "*-win32 *-musllinux* *i686 *ppc64le *s390x *aarch64"
CIBW_PLATFORM: ${{ matrix.platform || matrix.os }}
# TODO: why doesn't pytest work with cibuildwheel?
# CIBW_TEST_COMMAND: "pytest -v {project}/python/fastsim/tests"
CIBW_TEST_COMMAND: "python -m unittest discover {project}/python/fastsim/tests"
CIBW_ARCHS_MACOS: "universal2"
# see https://cibuildwheel.readthedocs.io/en/stable/faq/#universal2
CIBW_TEST_SKIP: "*_universal2:arm64"
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH"'
CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"'
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014"
CIBW_BEFORE_BUILD: >
pip install -U setuptools-rust &&
rustup default stable &&
rustup show
CIBW_BEFORE_BUILD_LINUX: >
yum -y install openssl openssl-devel &&
pip install -U setuptools-rust &&
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly --profile=minimal -y &&
rustup show
- name: list dist files
run: ${{ matrix.ls || `ls -lh` }} dist/
- uses: actions/upload-artifact@v4
with:
path: ./dist/*

0 comments on commit 11b0162

Please sign in to comment.