Skip to content

Commit

Permalink
micromamba
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger committed Mar 22, 2024
1 parent 4c4b8cc commit d8a3780
Showing 1 changed file with 95 additions and 22 deletions.
117 changes: 95 additions & 22 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,61 +10,77 @@ on:
jobs:
macos:
runs-on: macos-13
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
python-version: ['3.8'] #, '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
init-shell: bash
create-args: >-
python=${{ matrix.python-version }}
environment-name: cramjam
environment-file: environment.yml
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Install packages (macOS)
run: brew install ninja
- name: Set Env vars
run: |
echo $(which python)
echo "MACOSX_DEPLOYMENT_TARGET=14.0" >> $GITHUB_ENV
echo "PYO3_PYTHON=python${{ matrix.python-version }}" >> $GITHUB_ENV
echo "PYO3_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
echo "PYO3_LIB_DIR=$CONDA_PREFIX/lib" >> $GITHUB_ENV
echo "DYLD_FALLBACK_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig" >> $GITHUB_ENV
- uses: fawazahmed0/action-debug@main
- name: Tests
run: cargo test --no-default-features --release
run: cargo test --no-default-features --release --features use-system-blosc2
- name: Build wheels - x86_64 - cramjam-cli
uses: PyO3/maturin-action@v1
with:
target: x86_64
sccache: true
args: -i python --release --out dist --sdist --manifest-path cramjam-cli/Cargo.toml
args: --release --out dist --sdist --manifest-path cramjam-cli/Cargo.toml
- name: Build wheels - x86_64 - cramjam-python
uses: PyO3/maturin-action@v1
with:
target: x86_64
sccache: true
args: -i python --release --out dist --sdist --manifest-path cramjam-python/Cargo.toml
args: --release --out dist --sdist --manifest-path cramjam-python/Cargo.toml --features use-system-blosc2
- name: Install built wheels - x86_64
run: |
ls -l dist
pip install cramjam --pre --no-index --find-links dist --force-reinstall
pip install cramjam-cli --pre --no-index --find-links dist --force-reinstall
- name: Build wheels - universal2
if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11", "3.12"]'), matrix.python-version) }}
uses: PyO3/maturin-action@v1
with:
sccache: true
args: -i python --release --target universal2-apple-darwin --out dist --manifest-path cramjam-cli/Cargo.toml
args: --release --target universal2-apple-darwin --out dist --manifest-path cramjam-cli/Cargo.toml
- name: Build wheels - universal2
if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11", "3.12"]'), matrix.python-version) }}
uses: PyO3/maturin-action@v1
with:
sccache: true
args: -i python --release --target universal2-apple-darwin --out dist --manifest-path cramjam-python/Cargo.toml
args: --release --target universal2-apple-darwin --out dist --manifest-path cramjam-python/Cargo.toml --features use-system-blosc2
- name: Install built wheels - universal2
if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11", "3.12"]'), matrix.python-version) }}
run: |
pip install cramjam --pre --no-index --find-links dist --force-reinstall
pip install cramjam-cli --pre --no-index --find-links dist --force-reinstall
- name: Python UnitTest - cramjam-cli
run: |
pip install pytest numpy hypothesis
python -m pytest cramjam-cli -vs --ignore **/benchmarks
- name: Python UnitTest - cramjam-cli
run: python -m pytest cramjam-cli -vs --ignore **/benchmarks
- name: Python UnitTest - cramjam-python
run: |
python -m pytest cramjam-python -vs --ignore **/benchmarks
run: python -m pytest cramjam-python -vs --ignore **/benchmarks
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -117,20 +133,37 @@ jobs:
# path: dist

# linux:
# runs-on: ubicloud-standard-2
# runs-on: ubuntu-latest
# defaults:
# run:
# shell: bash -el {0}
# strategy:
# matrix:
# python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
# target: [x86_64, i686]
# python-version:
# # - '3.7'
# # - '3.8'
# # - '3.9'
# # - '3.10'
# # - '3.11'
# - '3.12'
# target:
# - x86_64
# # - i686
# steps:
# - uses: actions/checkout@v3
# - uses: conda-incubator/setup-miniconda@v3
# with:
# python-version: ${{ matrix.python-version }}
# miniconda-version: "latest"
# channels: conda-forge,defaults
# channel-priority: true
# activate-environment: cramjam
# environment-file: environment.yml
# - name: Install Rust toolchain
# uses: dtolnay/rust-toolchain@stable
# - name: Tests
# run: cargo test --no-default-features --release --features capi
# - uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
# run:
# LD_LIBRARY_PATH=$CONDA_PREFIX/lib cargo test --no-default-features --release
# - name: Audit
# run: cargo install cargo-audit && cargo audit
# - name: Build Wheels - cramjam-python
Expand Down Expand Up @@ -279,11 +312,51 @@ jobs:
# name: wheels
# path: dist

# musllinux:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python:
# - pypy3.9
# - pypy3.10
# - '3.7'
# - '3.8'
# - '3.9'
# - '3.10'
# - '3.11'
# - '3.12'
# target:
# - x86_64
# - i686
# - aarch64
# - armv7
# steps:
# - uses: actions/checkout@v3
# - name: Build Wheels cramjam-python
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.target }}
# sccache: true
# manylinux: musllinux_1_1
# args: -i ${{ matrix.python }} --release --out dist --manifest-path cramjam-python/Cargo.toml
# - name: Build Wheels cramjam-cli
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.target }}
# sccache: true
# manylinux: musllinux_1_1
# args: -i ${{ matrix.python }} --release --out dist --manifest-path cramjam-cli/Cargo.toml
# - name: Upload wheels
# uses: actions/upload-artifact@v3
# with:
# name: wheels
# path: dist

# pypi-publish-cramjam-python:
# name: Upload cramjam release to PyPI
# runs-on: ubuntu-latest
# if: "startsWith(github.ref, 'refs/tags/')"
# needs: [ macos, windows, linux, linux-cross, pypy ]
# needs: [ macos, windows, linux, linux-cross, pypy, musllinux ]
# environment:
# name: pypi
# url: https://pypi.org/p/cramjam
Expand All @@ -305,7 +378,7 @@ jobs:
# name: Upload cramjam-cli release to PyPI
# runs-on: ubuntu-latest
# if: "startsWith(github.ref, 'refs/tags/')"
# needs: [ macos, windows, linux, linux-cross, pypy ]
# needs: [ macos, windows, linux, linux-cross, pypy, musllinux ]
# environment:
# name: pypi
# url: https://pypi.org/p/cramjam-cli
Expand Down

0 comments on commit d8a3780

Please sign in to comment.